-
Notifications
You must be signed in to change notification settings - Fork 25
69 lines (67 loc) · 2.41 KB
/
daily.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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.environment == 'nightly'
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
- 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 ../glum/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/glum/actions/runs/${{ github.run_id }} for details.",
assignees: ["MarcAntoineSchmidtQC"],
labels: ["[bot] Daily run"]
})
}
});