-
Notifications
You must be signed in to change notification settings - Fork 2
184 lines (160 loc) · 5.65 KB
/
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
name: CI
on:
push:
branches:
- master
pull_request:
# branches:
# - master
workflow_dispatch: # manual trigger
schedule:
- cron: '3 2 8 * *'
jobs:
test:
name: "test: ${{ matrix.os }}, python ${{ matrix.python }}"
strategy:
#max-parallel: 4
fail-fast: false
matrix:
include:
- { os: ubuntu-20.04, python: '3.6' }
- { os: ubuntu-20.04, python: '3.7' }
- { os: ubuntu-20.04, python: '3.8' }
- { os: ubuntu-20.04, python: '3.9' }
- { os: ubuntu-22.04, python: '3.10' }
- { os: ubuntu-22.04, python: '3.11' }
- { os: ubuntu-22.04, python: '3.12' }
- { os: macos-12, python: '3.10' }
# TODO: enable
# disable it for a while
# Check status of https://github.com/actions/runner-images/issues/8500
# and https://github.com/actions/runner-images/issues/8529
#- { os: macos-13, python: '3.11' }
- { os: windows-2019, python: '3.7' }
- { os: windows-2019, python: '3.8' }
# At the moment of writing there was a regular problems with installing boost via choco:
# "The request was aborted: Could not create SSL/TLS secure channel."
#- { os: windows-2022, python: '3.10' }
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
########### cache
- name: Cache pip [Linux]
uses: actions/cache@v4
if: runner.os == 'Linux'
with:
path: ~/.cache/pip
key: ${{ matrix.os }}-pip-${{ matrix.python }}-${{ hashFiles('**/dev-requirements.txt', '**/requirements.txt') }}
- name: Cache pip [MacOS]
uses: actions/cache@v4
if: runner.os == 'macOS'
with:
path: ~/Library/Caches/pip
key: ${{ matrix.os }}-pip-${{ matrix.python }}-${{ hashFiles('**/dev-requirements.txt', '**/requirements.txt') }}
- name: Cache pip [Windows]
uses: actions/cache@v4
if: runner.os == 'Windows'
with:
path: ~\AppData\Local\pip\Cache
key: ${{ matrix.os }}-pip-${{ matrix.python }}-${{ hashFiles('**/dev-requirements.txt', '**/requirements.txt') }}
- name: Cache choco [Windows]
uses: actions/cache@v4
if: runner.os == 'Windows'
with:
path: ~\AppData\Local\Temp\chocolatey
key: ${{ matrix.os }}-choco-${{ hashFiles('**/gh-install-choco-deps.sh') }}
- name: Cache indy deps [Windows]
uses: actions/cache@v4
if: runner.os == 'Windows'
id: cache-windows-indy
with:
path: |
C:\local
C:\Qt
key: ${{ matrix.os }}-indy-${{ hashFiles('**/gh-install-choco-deps.sh', '**/gh-install-windows-qt.sh') }}
########## deps
- name: Install dependency packages
#if: startsWith(matrix.os,'ubuntu')
env:
CACHE_INDY_HIT: ${{ steps.cache-windows-indy.outputs.cache-hit }}
run: |
if [[ $RUNNER_OS == "Linux" ]]; then
sudo apt-get update
sudo ACCEPT_EULA=Y DEBIAN_FRONTEND=noninteractive apt-get upgrade --no-install-recommends --yes
sudo bash ./scripts/install-demos-deb-deps.sh
elif [[ $RUNNER_OS == "macOS" ]]; then
export HOMEBREW_NO_INSTALL_CLEANUP=1
export HOMEBREW_NO_AUTO_UPDATE=1
brew install boost
# deprecated
#brew install boost-python
# Formula qt5 was renamed to qt@5
brew install qt@5
# python -m pip install --upgrade pip
# python -m pip install --upgrade aqtinstall
# aqt install-qt --outputdir /usr/local/qt mac desktop 5.15.2 clang_64
brew install dmd
brew install ldc
elif [[ $RUNNER_OS == "Windows" ]]; then
chmod +x scripts/gh-install-choco-deps.sh
scripts/gh-install-choco-deps.sh
chmod +x scripts/gh-install-windows-qt.sh
scripts/gh-install-windows-qt.sh
fi
shell: bash
- name: Install pip modules
env:
PYTHON_VER: ${{ matrix.python }}
run: |
python -m pip install --upgrade pip
python -m pip install -r tests/requirements.txt
python -m pip install coveralls
if [[ $RUNNER_OS == "Linux" && $PYTHON_VER == '3.8' ]]; then
python -m pip install pyyaml
fi
shell: bash
########### tests
- name: Prapare tests [Windows]
if: runner.os == 'Windows'
run: |
Set-MpPreference -DisableArchiveScanning $true
Set-MpPreference -DisableRealtimeMonitoring $true
Set-MpPreference -DisableBehaviorMonitoring $true
shell: powershell
- name: Run tests
run: |
python -m pytest --cov zm tests -v -k "not zipapp" --maxfail=4
RESULT=$?
if (( $RESULT == 0 )); then
python -m pytest tests -v -k "zipapp" --maxfail=2
else
exit $RESULT
fi
shell: bash
- name: Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
COVERALLS_FLAG_NAME: ${{ matrix.os }}-py-${{ matrix.python }}
run: coveralls --service=github
shell: bash
continue-on-error: true
complete-coveralls:
needs: test
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Coveralls Finished
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pip install --upgrade coveralls
coveralls --finish
continue-on-error: true