-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
85 lines (79 loc) · 2.23 KB
/
.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
stages:
- build
- test
- cleanup
variables:
npm_config_cache: "$CI_PROJECT_DIR/.npm"
CYPRESS_CACHE_FOLDER: "$CI_BUILDS_DIR/cache/Cypress"
# cache using branch name
# https://gitlab.com/help/ci/caching/index.md
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- .npm
- cache/Cypress
- node_modules
build-develop:
except:
- tags
stage: build
tags:
- BaseX-9.2
- vicav
variables:
GIT_STRATEGY: clone
GIT_CLONE_PATH: $CI_BUILDS_DIR/vicav_webapp
VICAV_CONTENT_REPO: https://github.com/acdh-oeaw/vicav-content.git
HOME: /home/gitlab-runner
script:
- pwd
- cd $GIT_CLONE_PATH
- npm ci
# check Cypress binary path and cached versions
# useful to make sure we are not carrying around old versions
- npx cypress cache path
- npx cypress cache list
- $(npm bin)/cypress verify
- cd $CI_BUILDS_DIR
- ./vicav_webapp/scripts/gitlab-runner-setup.sh
run_tests:
except:
- tags
stage: test
tags:
- BaseX-9.2
- vicav
variables:
GIT_STRATEGY: clone
GIT_CLONE_PATH: $CI_BUILDS_DIR/vicav_webapp
SAXON_CP: $CI_BUILDS_DIR/../lib/custom/saxon9he.jar
CYPRESS_BASEX_ROOT: $CI_BUILDS_DIR/../
HOME: /home/gitlab-runner
script:
- mkdir -p $GIT_CLONE_PATH/artifacts
- rm -rf $GIT_CLONE_PATH/artifacts/* 2>/dev/null
- mkdir -p $GIT_CLONE_PATH/artifacts/xspec
- $GIT_CLONE_PATH/scripts/run-unit-tests.sh > $GIT_CLONE_PATH/artifacts/XUNIT_OUTPUT.txt
- $GIT_CLONE_PATH/scripts/run-xspecs.sh
- $(npm bin)/cypress run
artifacts:
when: always
expire_in: 1 day
paths:
- $GIT_CLONE_PATH/cypress
- $GIT_CLONE_PATH/artifacts
- $GIT_CLONE_PATH/xspec/xspec
clean-testbench:
stage: cleanup
tags:
- BaseX-9.2
- vicav
variables:
GIT_CLONE_PATH: $CI_BUILDS_DIR/vicav_webapp
script:
- rm -rf $GIT_CLONE_PATH 2>/dev/null
- mkdir -p $GIT_CLONE_PATH 2>/dev/null
- rm -rf $CI_BUILDS_DIR/vicav_content 2>/dev/null
- cd /opt/basex/bin/
- ./basexclient -Uadmin -Padmin -c "DROP DATABASE vicav_biblio; DROP DATABASE vicav_profiles; DROP DATABASE vicav_corpus; DROP DATABASE vicav_texts; DROP DATABASE vicav_samples; DROP DATABASE vicav_lingfeatures"
when: always