-
Notifications
You must be signed in to change notification settings - Fork 11
175 lines (160 loc) · 5.29 KB
/
test_prereleases.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
# An "early warning" cron job that will install dependencies
# with `pip install --pre` periodically to test for breakage
# (and open an issue if a test fails)
name: --pre Test
on:
push:
branches:
- master
- develop
schedule:
- cron: '0 */12 * * *' # every 12 hours
pull_request:
paths:
- '.github/workflows/test_prereleases.yml'
- 'pyproject.toml'
- 'requirements/pre_test_problematic_version.txt'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
concurrency:
group: pre-test-${{ github.ref }}
cancel-in-progress: true
jobs:
download_data:
name: Download test data
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- shell: bash
run: bash build_utils/download_data.sh
- name: Upload test data
uses: actions/upload-artifact@v4
with:
name: test_data
path: test_data
retention-days: 5
test:
name: ${{ matrix.platform }} py${{ matrix.python }} --pre
runs-on: ${{ matrix.platform }}
needs: download_data
strategy:
fail-fast: false
matrix:
platform: [windows-2022, macos-14, ubuntu-24.04]
python: [3.12]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: 'pip'
cache-dependency-path: 'pyproject.toml'
- name: Install Windows OpenGL
if: runner.os == 'Windows'
run: |
git clone --depth 1 git://github.com/pyvista/gl-ci-helpers.git
powershell gl-ci-helpers/appveyor/install_opengl.ps1
if (Test-Path -Path "C:\Windows\system32\opengl32.dll" -PathType Leaf) {Exit 0} else {Exit 1}
shell: powershell
- uses: tlambert03/setup-qt-libs@v1
- name: Download test data
uses: actions/download-artifact@v4
with:
name: test_data
path: test_data
- name: Install dependencies
run: |
pip install --upgrade pip
pip install setuptools tox tox-gh-actions>=2.12.0
- name: Test with tox base
# run tests using pip install --pre
uses: aganders3/headless-gui@v2
timeout-minutes: 60
with:
run: python -m tox run -v -- -v package/tests/test_PartSegImage package/tests/test_PartSegCore
env:
PLATFORM: ${{ matrix.platform }}
PYVISTA_OFF_SCREEN: True # required for opengl on windows
NAPARI: latest
BACKEND: PyQt6
PIP_CONSTRAINT: requirements/pre_test_problematic_version.txt
PIP_PRE: 1
- name: Test with tox linux
# run tests using pip install --pre
uses: aganders3/headless-gui@v2
timeout-minutes: 60
with:
run: python -m tox run -v -- -v package/tests/test_PartSeg
env:
PLATFORM: ${{ matrix.platform }}
PYVISTA_OFF_SCREEN: True # required for opengl on windows
NAPARI: latest
BACKEND: PyQt6
PIP_CONSTRAINT: requirements/pre_test_problematic_version.txt
PIP_PRE: 1
# If something goes wrong, we can open an issue in the repo
- name: Report Failures
if: ${{ failure() }}
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PLATFORM: ${{ matrix.platform }}
PYTHON: ${{ matrix.python }}
RUN_ID: ${{ github.run_id }}
TITLE: '[test-bot] pip install --pre is failing'
with:
filename: .github/TEST_FAIL_TEMPLATE.md
update_existing: true
pyinstaller:
name: "Test pyinstaller build"
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: 3.x
- uses: tlambert03/setup-qt-libs@v1
- name: Install uv
run: pip install uv
- name: Compile PyInstaller requirements
run: |
uv pip compile --prerelease allow --python-version 3.12 --upgrade -o requirements.txt pyproject.toml requirements/pre_test_problematic_version.txt --extra pyinstaller
- name: Install dependencies
run: |
uv venv --python 3.12
uv pip install -r requirements.txt
uv pip install .
- name: upload requirements
uses: actions/upload-artifact@v4
with:
name: requirements
path: requirements.txt
- name: Run PyInstaller
run: |
source .venv/bin/activate
python build_utils/create_and_pack_executable.py
- name: Upload bundle
uses: actions/upload-artifact@v4
with:
name: bundle
path: dist2/
- name: Test bundle
uses: aganders3/headless-gui@v2
timeout-minutes: 60
with:
run: dist/PartSeg/PartSeg _test
# If something goes wrong, we can open an issue in the repo
- name: Report Failures
if: ${{ failure() }}
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PLATFORM: "linux"
PYTHON: "3.12"
RUN_ID: ${{ github.run_id }}
TITLE: '[test-bot] pyinstaller bundle --pre is failing'
with:
filename: .github/TEST_FAIL_TEMPLATE.md
update_existing: true