Daily runs #706
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: | |
jobs: | |
linux-daily-unittests: | |
name: "Linux - daily unit tests - Python ${{ matrix.PYTHON_VERSION }} - ${{ matrix.NOTE }}" | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- PYTHON_VERSION: '3.9' | |
NOTE: 'Nightly Builds' # run once with nightlies | |
- PYTHON_VERSION: '3.9' | |
NOTE: 'Default Builds' # run once with normal dependencies | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@v4 | |
- uses: mamba-org/setup-micromamba@54d4d5980e1a4aa7cdc8b050cf2d19b7e262ce18 | |
with: | |
environment-file: environment.yml | |
create-args: >- | |
python=${{ matrix.PYTHON_VERSION }} | |
- name: Install nightlies | |
if: matrix.NOTE == 'Nightly Builds' | |
shell: bash -el {0} | |
run: | | |
PRE_WHEELS="https://pypi.anaconda.org/scipy-wheels-nightly/simple" | |
for pkg in numpy pandas scipy; do | |
echo "Installing $pkg nightly" | |
micromamba remove -y --force $pkg | |
pip install --pre --no-deps --only-binary :all: --upgrade --timeout=60 -i $PRE_WHEELS $pkg | |
done | |
- name: Install repository | |
shell: bash -el {0} | |
run: pip install --no-use-pep517 --no-deps --disable-pip-version-check -e . | |
- name: Run pytest | |
shell: bash -el {0} | |
run: pytest -nauto tests -m "not high_memory" --doctest-modules src/ | |
- name: Issue on failure | |
uses: actions/github-script@v6 | |
if: ${{ failure() }} | |
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"] | |
}) | |
} | |
}); |