forked from ManimCommunity/ManimPango
-
Notifications
You must be signed in to change notification settings - Fork 0
203 lines (198 loc) · 6.29 KB
/
tests.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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
name: Test
on:
push:
branches: [main,tests-build]
pull_request:
branches: [main]
jobs:
test:
name: ${{ matrix.os }} - ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ['3.7', '3.8', '3.9', '3.10']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependency and Configure
if: runner.os == 'macOS'
run: |
brew install cairo
echo "LD_LIBRARY_PATH=$HOME/pangoprefix/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=$HOME/pangoprefix/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV
- name: Set ENV
if: runner.os == 'Linux'
run: |
echo "LD_LIBRARY_PATH=$HOME/pangoprefix/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=$HOME/pangoprefix/lib/x86_64-linux-gnu/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV
- name: Cache Pango
id: cache-pango
uses: actions/cache@v2
with:
path: ~/pangoprefix
key: ${{ hashFiles('packing/build_pango_tests.sh') }}-${{ runner.os }}
- name: Install System Dependency
if: steps.cache-pango.outputs.cache-hit != 'true'
run: |
source packing/build_pango_tests.sh
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Run Tests
run: |
python setup.py build_ext -i --coverage
python setup.py sdist
pip install .
pytest
- name: Coverage
run: |
coverage report
coverage html
coverage xml
- uses: codecov/codecov-action@v1
with:
file: ./.coverage/coverage.xml
- uses: actions/upload-artifact@v2
with:
name: test-artifacts-${{matrix.os}}-${{matrix.python-version}}
path: .pytest_temp/
msys:
name: Test on Msys2
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- msystem: MINGW64
arch: x86_64
- msystem: MINGW32
arch: i686
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: setup-msys2
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.msystem }}
release: false
install: >-
mingw-w64-${{ matrix.arch }}-toolchain
mingw-w64-${{ matrix.arch }}-pango
mingw-w64-${{ matrix.arch }}-python
mingw-w64-${{ matrix.arch }}-python-pip
mingw-w64-${{ matrix.arch }}-cython
- name: Install dependencies
shell: msys2 {0}
run: |
pip install -r requirements-dev.txt
- name: Run tests
shell: msys2 {0}
run: |
export SETUPTOOLS_USE_DISTUTILS=stdlib
pip install .
python setup.py build_ext -i --coverage
python setup.py sdist
python -m pip install dist/*
pytest
- name: Coverage
shell: msys2 {0}
run: |
coverage report
coverage html
coverage xml
- uses: codecov/codecov-action@v1
with:
file: ./.coverage/coverage.xml
- uses: actions/upload-artifact@v2
with:
name: test-artifacts-${{matrix.os}}
path: .pytest_temp/
msvc:
name: ${{matrix.os}} - ${{matrix.python-version}}
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [windows-2022]
python-version: ['3.7', '3.8', '3.9', '3.10']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }} for x64
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: "x64"
- name: Cache Windows
id: cache-windows
uses: actions/cache@v2
with:
path: C:\cibw\pkg-config
key: ${{ hashFiles('packing/download_dlls.py') }}-${{ hashFiles('packing/build_pkgconfig.ps1') }}-1
- name: Download Binary
run: |
python packing/download_dlls.py
- name: Set Path
run: |
$env:Path = "C:\cibw\pkg-config\bin;C:\cibw\vendor\bin;$($env:PATH)"
echo "$env:Path" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Test x64
run: |
pip install -U setuptools wheel
$env:PKG_CONFIG_PATH="C:\cibw\vendor\lib\pkgconfig"
pip install -r requirements-dev.txt
python setup.py build_ext -i --coverage
pytest
- name: Coverage
run: |
coverage report
coverage html
coverage xml
- name: Set up Python ${{ matrix.python-version }} for x86
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: "x86"
- name: Download Binary
run: |
python packing/download_dlls.py
- name: Build x86 Build
run: |
$env:PATH="$env:PATH;C:\cibw\vendor\pkg-config\bin;C:\cibw\vendor\bin"
$env:PKG_CONFIG_PATH="C:\cibw\vendor\lib\pkgconfig"
pip install -r requirements-dev.txt
python setup.py build_ext -i --coverage
python setup.py sdist
python -m pip install dist/*
$env:PATH="C:\cibw\vendor\bin;$env:PATH"
pytest
- name: Coverage
run: |
coverage report
coverage html
coverage xml
- uses: codecov/codecov-action@v1
with:
file: ./.coverage/coverage.xml
- uses: actions/upload-artifact@v2
with:
name: test-artifacts-${{matrix.os}}-${{matrix.python-version}}
path: .pytest_temp/
success-win:
needs: [msvc, msys]
runs-on: ubuntu-latest
name: Windows Test Successful
steps:
- name: Success
run: echo Windows Test Successful
success-all:
needs: [test]
runs-on: ubuntu-latest
name: Mac and Linux Test Successful
steps:
- name: Success
run: echo Mac and Linux Test Successful