Skip to content

uncomment

uncomment #646

Workflow file for this run

name: Daily runs
on:
schedule:
- cron: '0 5 * * *'
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
env:
CI: True
strategy:
fail-fast: false
matrix:
include:
- PYTHON_VERSION: '3.10'
NOTE: 'Nightly Builds' # run once with nightlies
- PYTHON_VERSION: '3.10'
NOTE: 'Default Builds' # run once with normal dependencies
steps:
- name: Checkout branch
uses: actions/checkout@v3
- uses: mamba-org/setup-micromamba@875557da4ee020f18df03b8910a42203fbf02da1
with:
environment-file: environment.yml
create-args: >- # h2o-py and openjdk from environment-benchmark.yml
python=${{ matrix.PYTHON_VERSION }}
h2o-py
openjdk
- name: Install nightlies
if: matrix.NOTE == 'Nightly Builds'
shell: bash -el {0}
run: |
# needed for tabmat
echo "Install compilation dependencies"
micromamba install -y c-compiler cxx-compiler cython jemalloc-local libgomp mako xsimd
PRE_WHEELS="https://pypi.anaconda.org/scipy-wheels-nightly/simple"
for pkg in numpy pandas scikit-learn 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
echo Install tabmat nightly
micromamba remove -y --force tabmat
pip install git+https://github.com/Quantco/tabmat
- 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 --doctest-modules src/glum/
- name: Run doctest
shell: bash -el {0}
# 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
python -m doctest -v README.md
- 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/glum/actions/runs/${{ github.run_id }} for details.",
assignees: ["MarcAntoineSchmidtQC"],
labels: ["[bot] Daily run"]
})
}
});