Skip to content

Daily runs

Daily runs #928

Workflow file for this run

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 - 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@422500192359a097648154e8db4e39bdb6c6eed7
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/scientific-python-nightly-wheels/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
micromamba list
- 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@v7
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"]
})
}
});