forked from hyunchan-park/JOTA-dmoj-judge-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
58 lines (58 loc) · 2.03 KB
/
.travis.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
dist: bionic
services:
- docker
language: minimal
addons:
apt:
packages:
- jq
jobs:
include:
- env: DMOJ_USE_SECCOMP="yes" PYTHON_VERSION=3.8 ARCH=aarch64 DOCKER_IMAGE=dmoj/runtimes-tier1
arch: arm64
- env: DMOJ_USE_SECCOMP="yes" PYTHON_VERSION=3.9 ARCH=aarch64 DOCKER_IMAGE=dmoj/runtimes-tier1
arch: arm64
- env: DMOJ_USE_SECCOMP="no" PYTHON_VERSION=3.9 ARCH=aarch64 DOCKER_IMAGE=dmoj/runtimes-tier1
arch: arm64
install:
- docker pull "$DOCKER_IMAGE"
- |
curl -L "https://github.com/DMOJ/runtimes-python/releases/latest/download/python$PYTHON_VERSION-$ARCH.tar.gz" |
tar -xz
cache:
directories:
- /home/travis/.cache/pip
script:
- |
cat > run <<'EOF'
#!/bin/bash -e
export PYTHONUNBUFFERED=1
export LANG=C.UTF-8
export PYTHONIOENCODING=utf8
cd /code
export PYTHON="/code/python$PYTHON_VERSION/bin/python$PYTHON_VERSION"
"$PYTHON" -m pip install --upgrade pip wheel
"$PYTHON" -m pip install cython coverage
"$PYTHON" -m pip install -e .[test]
chmod o+w .
runuser -u judge -w PATH /code/run-su
EOF
- |
cat > run-su <<'EOF'
#!/bin/bash -e
. ~/.profile
cd /code
"$PYTHON" -W 'ignore::ResourceWarning,error' -m coverage run -m unittest discover dmoj/tests/
"$PYTHON" -W 'ignore::ResourceWarning,error' -m coverage run --append .docker.test.py
"$PYTHON" -m coverage combine
"$PYTHON" -m coverage xml
EOF
- chmod a+x run run-su
- mkdir -p /home/travis/.cache/pip && sudo chown root:root -R /home/travis/.cache/pip
- docker run -e PYTHON_VERSION="$PYTHON_VERSION" -e DMOJ_USE_SECCOMP="$DMOJ_USE_SECCOMP" -v "$(pwd):/code" -v /home/travis/.cache:/root/.cache --cap-add=SYS_PTRACE "$DOCKER_IMAGE"
- sudo chown -R travis:travis /home/travis/.cache/pip
after_script:
- bash <(curl -s https://codecov.io/bash)
notifications:
slack:
secure: Ip7Hi4IQpRv1PisnB+9FUuxaYwu9piaxTeDumpcRhiO7o1btiLeGf+bVdXZJB9IU3AkH0p163UtxQeAj9yxts3iWKQsQnJKAVrSWw+wwB+aoIGYu40qRka0Lxrft91TU6k0NRAYaOYnn1ogZbNuZUyO3GB1H8xZjDiCFdHaoYdM=