-
Notifications
You must be signed in to change notification settings - Fork 14
157 lines (153 loc) · 5.04 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
name: Test
on:
push:
branches: [main,tests-build,v*]
pull_request:
branches: [main,v*]
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.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- 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@v3
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
python setup.py sdist
pip install .
pytest
- name: Coverage
run: |
coverage report
coverage html
coverage xml
- uses: codecov/codecov-action@v3
with:
file: ./.coverage/coverage.xml
- uses: actions/upload-artifact@v3
with:
name: test-artifacts-${{matrix.os}}-${{matrix.python-version}}
path: .pytest_temp/
msvc:
name: ${{matrix.os}} - ${{matrix.python-version}}
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [windows-2022]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }} for x64
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: "x64"
allow-prereleases: true
- name: Cache Windows
id: cache-windows
uses: actions/cache@v3
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: |
python -m pip install -U pip
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
pytest
- name: Coverage
run: |
coverage report
coverage html
coverage xml
- name: Set up Python ${{ matrix.python-version }} for x86
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: "x86"
allow-prereleases: true
- name: Download Binary
run: |
python packing/download_dlls.py
- name: Build x86 Build
run: |
python -m pip install -U pip
$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
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@v3
with:
file: ./.coverage/coverage.xml
- uses: actions/upload-artifact@v3
with:
name: test-artifacts-${{matrix.os}}-${{matrix.python-version}}
path: .pytest_temp/
success-win:
needs: [msvc]
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