1 | ### Stages
|
2 | ##
|
3 | #
|
4 | stages:
|
5 | - test
|
6 |
|
7 | ### Cache
|
8 | ## the key is "branch_name:job_name" to prevent incompatibilities between node versions
|
9 | #
|
10 | cache:
|
11 | key: "${CI_COMMIT_REF_NAME}:${CI_JOB_NAME}"
|
12 | paths:
|
13 | - node_modules/
|
14 |
|
15 | ### Jobs template
|
16 | ##
|
17 | #
|
18 | .test_template:
|
19 | stage: test
|
20 | script:
|
21 | - npm install
|
22 | - npm run frontend:build
|
23 | - if [[ $(git status | grep -c "nothing to commit, working tree clean") -ne 1 ]]; then echo "*** You did’nt build the frontend! Aborting. Please run `make build` and commit ***"; exit 1; fi
|
24 | - npm run lint
|
25 | - npm run test
|
26 | - npm run test-ldap
|
27 | retry: 2
|
28 |
|
29 | ### Services
|
30 | ##
|
31 | # Bring in any services we need
|
32 | # http://docs.gitlab.com/ee/ci/docker/using_docker_images.html#what-is-a-service
|
33 | services:
|
34 | - rroemhild/test-openldap
|
35 |
|
36 | ### Jobs
|
37 | ##
|
38 | #
|
39 |
|
40 | ## Tests
|
41 | #
|
42 | test_node_latest:
|
43 | image: node:latest
|
44 | <<:
|
45 |
|
46 | test_node_8:
|
47 | image: node:8-buster
|
48 | <<:
|
49 |
|
50 | test_node_9:
|
51 | image: node:9-stretch
|
52 | before_script:
|
53 | - npm install -g npm
|
54 | <<:
|
55 |
|
56 | test_node_10:
|
57 | image: node:10-buster
|
58 | <<:
|
59 |
|
60 | test_node_12:
|
61 | image: node:12-buster
|
62 | <<:
|
63 |
|
64 | test_node_13:
|
65 | image: node:13-buster
|
66 | <<:
|