-
Notifications
You must be signed in to change notification settings - Fork 7
/
.gitlab-ci.yml
90 lines (81 loc) · 2.18 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
86
87
88
89
90
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
CI_DEBUG_SERVICES: "FALSE"
FREECIV_IMAGE_VERSION: civrealm/freeciv-web:dev
cache:
key: "${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}"
paths:
- .cache/pip
- venv/
.before_script_template:
before_script:
- "python3 --version"
- "pip install virtualenv -i https://pypi.tuna.tsinghua.edu.cn/simple"
- "virtualenv venv"
- "source venv/bin/activate"
.python_test_template: &python_test_template
stage: tests
services:
- name: $FREECIV_IMAGE_VERSION
alias: freeciv
entrypoint:
- "/bin/bash"
- "-c"
- |
until [ -f "$CI_PROJECT_DIR/.git/index" ]; do true ; done;
while [ -f "$CI_PROJECT_DIR/.git/index.lock" ]; do true ; done;
python3 "$CI_PROJECT_DIR/tests/copy_ci_test_saves.py"
/docker/docker-entrypoint.sh && sleep infinity
variables:
CIVREALM_HOST_URL: "freeciv"
CIVREALM_HOST_PORT: "80"
RUNNER_SCRIPT_TIMEOUT: 50m
script:
- "pip install -e . -i https://pypi.tuna.tsinghua.edu.cn/simple"
- until curl --output /dev/null --silent --fail "$CIVREALM_HOST_URL:$CIVREALM_HOST_PORT/pubstatus"; do sleep 60 && echo "Waiting for freeciv-web server to set up!" ; done;
- "pytest -vv -x"
allow_failure: true
artifacts:
when: on_failure
name: "FailureLog$CI_JOB_ID"
paths:
- logs
tags:
- civ-pytest
only:
- dev
stages:
- pages
- tests
pages:
extends: .before_script_template
stage: pages
image: python:latest
script:
- "pip install mkdocs mkdocs-autorefs mkdocs-material mkdocstrings[python] mkdocs-table-reader-plugin mkdocs-meta-descriptions-plugin -i https://pypi.tuna.tsinghua.edu.cn/simple"
- mkdocs build
artifacts:
paths:
- public
only:
- dev
test_python3.8:
image: python:3.8
extends:
- .before_script_template
<<: *python_test_template
test_python3.9:
image: python:3.9
extends:
- .before_script_template
<<: *python_test_template
test_python3.10:
image: python:3.10
extends:
- .before_script_template
<<: *python_test_template
test_python3.11:
image: python:3.11
extends:
- .before_script_template
<<: *python_test_template