-
Notifications
You must be signed in to change notification settings - Fork 0
/
Test.gitlab-ci.yml
37 lines (37 loc) · 1.07 KB
/
Test.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
test:
variables:
POSTGRES_VERSION: 9.6.16
POSTGRES_DB: test
services:
- "postgres:${POSTGRES_VERSION}"
stage: test
image: registry.gitlab.com/acdh-oeaw/docker/herokuish-for-cypress/master:latest
needs: []
script:
- |
if [ -z ${KUBERNETES_PORT+x} ]; then
DB_HOST=postgres
else
DB_HOST=localhost
fi
- export DATABASE_URL="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DB_HOST}:5432/${POSTGRES_DB}"
- cp -R . /tmp/app
- export CYPRESS_VIDEOS_FOLDER=${CI_PROJECT_DIR}/cypress/videos
- export CYPRESS_SCREENSHOTS_FOLDER=${CI_PROJECT_DIR}/cypress/videos
- /bin/herokuish buildpack test
- TEST_STATUS=$?
- cp /app/coverage . || true
- echo "Test exit code $TEST_STATUS"
- exit $TEST_STATUS
rules:
- if: '$TEST_DISABLED'
when: never
- if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH'
artifacts:
when: always
paths:
# save both cypress artifacts and coverage results
- coverage
- cypress/videos/**/*.mp4
- cypress/screenshots/**/*.png
expire_in: 10 days