forked from DOMjudge/domjudge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
77 lines (72 loc) · 2.05 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
variables:
SAST_DEFAULT_ANALYZERS: "flawfinder, phpcs-security-audit, eslint, secrets"
stages:
- test
include:
- template: Dependency-Scanning.gitlab-ci.yml
- template: SAST.gitlab-ci.yml
- template: License-Scanning.gitlab-ci.yml
check syntax:
stage: test
image: domjudge/gitlabci:1.0
script:
- ./gitlab/syntax.sh
run unit tests:
stage: test
image: domjudge/gitlabci:1.0
# Disabled for now as it drastically speeds up running unit tests and we don't use it yet
# before_script:
# - apt-get update -yqq
# - apt-get install php-xdebug -yqq
services:
- mariadb
variables:
MYSQL_ROOT_PASSWORD: password
script:
- ./gitlab/unit-tests.sh
artifacts:
when: always
paths:
- unit-tests.xml
reports:
junit:
- unit-tests.xml
cache:
key: unit-tests
paths:
- lib/vendor/
integration:
stage: test
before_script:
# Takes about 1 minute to pull
- echo -e "section_start:`date +%s`:docker\r\e[0Kdocker pull"
- time docker pull domjudge/gitlabci:1.0
- echo -e "section_end:`date +%s`:docker\r\e[0K"
image: docker:stable
services:
- docker:19-dind
- mariadb
variables:
MYSQL_ROOT_PASSWORD: password
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
script:
- |
docker run --privileged \
-v $CI_PROJECT_DIR:$CI_PROJECT_DIR \
--net=host \
-e "TERM=xterm-256color" -e "HOME=$HOME" -e "USER=$USER" -e "MARIADB_PORT_3306_TCP_ADDR=$MARIADB_PORT_3306_TCP_ADDR" -e "MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD" \
domjudge/gitlabci:1.0 /bin/bash -eo pipefail -c "umask 0002; cd $CI_PROJECT_DIR; script --return -qfc \"./gitlab/integration.sh\" /dev/null | ts \"[%F %T]\" "
artifacts:
when: always
paths:
- misc-tools/icpctools/dj-events.json
- misc-tools/icpctools/dj-scoreboard.json
- misc-tools/icpctools/cds-events.json
- misc-tools/icpctools/cds-scoreboard.json
# TODO: Re-enable when gitlab is in better shape...
# cache:
# key: integration
# paths:
# - lib/vendor/
# - chroot