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 | - git status
|
24 | - git checkout -- package-lock.json
|
25 | - 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
|
26 | - npm run lint
|
27 | - npm run test
|
28 | - npm run test-ldap
|
29 | retry: 2
|
30 |
|
31 | ### Services
|
32 | ##
|
33 | # Bring in any services we need
|
34 | # http://docs.gitlab.com/ee/ci/docker/using_docker_images.html#what-is-a-service
|
35 | services:
|
36 | - rroemhild/test-openldap
|
37 |
|
38 | ### Jobs
|
39 | ##
|
40 | #
|
41 |
|
42 | ## Tests
|
43 | #
|
44 | # test_node_latest:
|
45 | # image: node:latest
|
46 | # <<: *test_definition
|
47 |
|
48 | test_node_8:
|
49 | image: node:8-buster
|
50 | <<:
|
51 |
|
52 | test_node_9:
|
53 | image: node:9-stretch
|
54 | before_script:
|
55 | - npm install -g npm
|
56 | <<:
|
57 |
|
58 | test_node_10:
|
59 | image: node:10-buster
|
60 | <<:
|
61 |
|
62 | test_node_12:
|
63 | image: node:12-buster
|
64 | <<:
|
65 |
|
66 | test_node_13:
|
67 | image: node:13-buster
|
68 | <<:
|
69 |
|
70 | test_node_14:
|
71 | image: node:14-buster
|
72 | <<:
|
73 |
|
74 | # test_node_15:
|
75 | # image: node:15-buster
|
76 | # <<: *test_definition
|