-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy path.gitlab-ci.yml
39 lines (35 loc) · 1007 Bytes
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
stages:
- test
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/pip-cache"
cache:
paths:
- "$CI_PROJECT_DIR/pip-cache"
- "$CI_PROJECT_DIR/.venv"
# prebuild a docker image to speed up the test suite
build-ci-test-image:
stage: test
image: docker:stable
stage: test
services:
- docker:dind
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build -t $CI_REGISTRY/$CI_PROJECT_PATH/gitlab-ci-test:$CI_COMMIT_REF_NAME -f tests/Dockerfile .
- docker push $CI_REGISTRY/$CI_PROJECT_PATH/gitlab-ci-test:$CI_COMMIT_REF_NAME
when: manual # trigger manually to rebuild the image, if necessary
interruptible: true
test:
stage: test
image: $CI_REGISTRY/$CI_PROJECT_PATH/gitlab-ci-test:master
variables:
LC_ALL: "C.UTF-8"
LANG: "C.UTF-8"
script:
- make tests
- make test_cloc
interruptible: true
# do not run tests on these branches
# rules:
# - if: $CI_COMMIT_BRANCH == "do-not-test"
# when: never