Daily runs #1170
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Daily runs | |
on: | |
schedule: | |
- cron: '0 5 * * *' | |
workflow_dispatch: | |
push: | |
paths: | |
- '.github/workflows/daily.yml' | |
jobs: | |
linux-daily-unittests: | |
name: "Linux - daily unit tests - ${{ matrix.NOTE }}" | |
runs-on: ubuntu-latest | |
env: | |
CI: True | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- environment: 'nightly' | |
NOTE: 'Nightly Builds' # run once with nightlies | |
- environment: 'py312' | |
NOTE: 'Python 3.12' # run once with normal dependencies | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@v4 | |
- name: Set up pixi | |
uses: prefix-dev/setup-pixi@992a3081e2f87829e0fff9fb29f4fe6a5d1e80a2 | |
with: | |
environments: ${{ matrix.environment }} | |
- name: Install nightlies | |
if: matrix.NOTE == 'Nightly Builds' | |
run: pixi run -e ${{ matrix.environment }} install-nightlies | |
- name: Install repository | |
run: pixi run -e ${{ matrix.environment }} postinstall | |
- name: Run pytest | |
run: pixi run -e ${{ matrix.environment }} test -nauto -m "not high_memory" | |
- name: Run doctest | |
# Check that the readme example will work by running via doctest. | |
# We run outside the repo to make the test a bit more similar to | |
# a user running after installing with conda. | |
run: | | |
mkdir ../temp | |
cp README.md ../temp | |
cd ../temp | |
pixi run --manifest-path ../tabmat/pixi.toml -e ${{ matrix.environment }} python -m doctest -v README.md | |
- name: Issue on failure | |
uses: actions/github-script@v7 | |
if: ${{ failure() && github.ref == 'refs/heads/main' }} | |
with: | |
script: | | |
github.rest.issues.listForRepo({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
state: "open", | |
labels: "[bot] Daily run" | |
}).then((issues) => { | |
if (issues.data.length === 0){ | |
github.rest.issues.create({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
title: "Daily run failure: Unit tests", | |
body: "The daily unit tests failed. See https://github.com/Quantco/tabmat/actions/runs/${{ github.run_id }} for details.", | |
assignees: ["MarcAntoineSchmidtQC"], | |
labels: ["[bot] Daily run"] | |
}) | |
} | |
}); |