Skip to content

--pre Test

--pre Test #3757

# 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