-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
79 lines (70 loc) · 1.79 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
image: python:3.10-slim
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
PIPENV_VENV_IN_PROJECT: 1
FOE_BOT_USERNAME: $FOE_BOT_USERNAME
FOE_BOT_PASSWORD: $FOE_BOT_PASSWORD
FOE_BOT_WORLD: $FOE_BOT_WORLD
FOE_BOT_DEEPL_API_KEY: $FOE_BOT_DEEPL_API_KEY
cache:
paths:
- .cache/pip
- .venv/
before_script:
- pip install pipenv
- apt-get update
- apt-get install -y --no-install-recommends gcc upx
- pipenv install --dev
stages:
- test
- package
.lint:
stage: test
script:
- pipenv run mypy
- pipenv run flake8
test:
stage: test
before_script:
- pip install pipenv
- apt-get update
- apt-get install -y --no-install-recommends xvfb wget gnupg
- |-
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - &&
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list
- apt-get update
- apt-get install -y google-chrome-stable
- pipenv install --dev
script:
- |-
export DISPLAY=:99 &&
Xvfb :99 -ac -screen 0 ${XVFB_WHD:-1280x720x16} -nolisten tcp &
pipenv run pytest --cov --cov-fail-under=50 --junitxml=report.xml
artifacts:
when: always
reports:
junit: report.xml
package-linux:
stage: package
only:
- master
script:
- pipenv run pyinstaller --name foe-bot --onefile --windowed ./foe_bot/app.py
artifacts:
paths:
- dist/foe-bot
expire_in: 4 weeks
package-windows:
stage: package
only:
- master
image: tobix/pywine:3.10
before_script:
- wine pip install pipenv
- wine pipenv install --dev
script:
- wine pipenv run pyinstaller --name foe-bot --onefile --windowed ./foe_bot/app.py
artifacts:
paths:
- dist/foe-bot.exe
expire_in: 4 weeks