| 1 |
name: Scheduled pre-release tests |
| 2 |
|
| 3 |
on: |
| 4 |
schedule: |
| 5 |
# Run this workflow twice a week |
| 6 |
# ref: https://crontab.guru/#0_5_*_*_1,4 |
| 7 |
- cron: "0 5 * * 1,4" |
| 8 |
workflow_dispatch: |
| 9 |
|
| 10 |
env: |
| 11 |
FORCE_COLOR: "1" # Make tools pretty |
| 12 |
PIP_DISABLE_PIP_VERSION_CHECK: "1" # Don't check for pip updates |
| 13 |
|
| 14 |
permissions: {} |
| 15 |
|
| 16 |
jobs: |
| 17 |
prerelease: |
| 18 |
# only run this workflow for pydata owned repositories (avoid forks) |
| 19 |
if: github.repository_owner == 'pydata' |
| 20 |
runs-on: ubuntu-latest |
| 21 |
strategy: |
| 22 |
fail-fast: false |
| 23 |
matrix: |
| 24 |
python-version: ["3.10", "3.14"] |
| 25 |
|
| 26 |
steps: |
| 27 |
- name: "Checkout repository 🛎" |
| 28 |
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd |
| 29 |
with: |
| 30 |
persist-credentials: false |
| 31 |
|
| 32 |
- name: "Setup CI environment 🛠" |
| 33 |
# Important: make sure to update the SHA after making any changes to the set-dev-env action |
| 34 |
uses: pydata/pydata-sphinx-theme/.github/actions/set-dev-env@e8db643b990df73812cf9397bc0f8cfa1164e4d3 |
| 35 |
with: |
| 36 |
python-version: ${{ matrix.python-version }} |
| 37 |
pandoc: true |
| 38 |
|
| 39 |
- name: "Install (prerelease) dependencies 📦" |
| 40 |
run: | |
| 41 |
python -Im pip install --upgrade pip wheel setuptools |
| 42 |
|
| 43 |
- name: "Build PST docs and check for warnings 📖" |
| 44 |
run: | |
| 45 |
# example substitution: tox run -e docs-py312-docs |
| 46 |
python -Im tox run -e docs-py$(echo ${{ matrix.python-version }} | tr -d .)-docs -- --keep-going |
| 47 |
|
| 48 |
- name: "Run tests ✅ (no coverage)" |
| 49 |
run: | |
| 50 |
# this will compile the assets then run the tests |
| 51 |
python -Im tox run -e compile-assets,i18n-compile,py$(echo ${{ matrix.python-version }} | tr -d .)-tests-no-cov |
| 52 |
echo "PYTEST_ERRORS=$?" >> $GITHUB_ENV |
| 53 |
|
| 54 |
- name: "Build and inspect package 📦" |
| 55 |
uses: hynek/build-and-inspect-python-package@fe0a0fb1925ca263d076ca4f2c13e93a6e92a33e # 2.17.0 |
| 56 |
if: matrix.python-version == '3.10' |
| 57 |
id: baipp |
| 58 |
with: |
| 59 |
# pydantic-core (via PyO3) does not yet support Python 3.14 |
| 60 |
python-version: "3.13" |
| 61 |
|
| 62 |
- run: echo Packages can be found at "${BAIPP_DIST}" |
| 63 |
if: matrix.python-version == '3.10' |
| 64 |
env: |
| 65 |
BAIPP_DIST: ${{ steps.baipp.outputs.dist }} |
| 66 |
|
| 67 |
# Run tests on the built package (which will be later uploaded to PyPI) |
| 68 |
- name: "Install PST from wheel and test" |
| 69 |
if: matrix.python-version == '3.10' |
| 70 |
env: |
| 71 |
BAIPP_DIST: ${{ steps.baipp.outputs.dist }} |
| 72 |
run: | |
| 73 |
dist_loc="${BAIPP_DIST}" |
| 74 |
# calling with --installpkg so we can use the already built package |
| 75 |
tox run -e py312-tests-no-cov \ |
| 76 |
--installpkg $dist_loc/*.whl \ |
| 77 |
-- --deselect tests/test_build.py::test_translations |
| 78 |
|
| 79 |
# If either the docs build or the tests resulted in an error, create an issue to note it |
| 80 |
- name: "Create an issue if failure" |
| 81 |
uses: JasonEtco/create-an-issue@1b14a70e4d8dc185e5cc76d3bec9eab20257b2c5 |
| 82 |
if: ${{ env.SPHINX_BUILD_UNEXPECTED_WARNINGS || !env.PYTEST_ERRORS }} |
| 83 |
env: |
| 84 |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 85 |
with: |
| 86 |
filename: .github/prerelease-template.md |