-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (69 loc) · 2.24 KB
/
Copy pathci.yml
File metadata and controls
79 lines (69 loc) · 2.24 KB
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
70
71
72
73
74
75
76
77
78
79
name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
notebooks:
name: Ноутбуки запускаются
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# A reader on Windows who cannot run the notebook has no course, so
# Windows is checked on every push rather than assumed to work.
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.12"
cache: pip
- run: pip install -r requirements.txt
# Executed to a throwaway copy: the point is that they still run, not to
# rewrite the committed outputs on every push.
- name: Выполнить каждый ноутбук
shell: bash
run: |
for nb in notebooks/*.ipynb; do
echo "::group::$nb"
jupyter nbconvert --to notebook --execute \
--ExecutePreprocessor.timeout=600 \
--output-dir "$RUNNER_TEMP/executed" "$nb"
echo "::endgroup::"
done
site:
name: Сайт собирается
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.12"
cache: pip
- run: pip install -r requirements.txt
# --strict fails on a broken internal link or a page missing from the
# navigation, which is the breakage nobody notices until a reader hits it.
- run: mkdocs build --strict
ci:
name: CI
runs-on: ubuntu-latest
if: always()
needs: [notebooks, site]
steps:
# One aggregate check to require in branch protection. Without it, adding
# an operating system to the notebook matrix silently leaves it
# unrequired, and a red job stops blocking merges.
- name: Fail if any job did not succeed
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: |
echo "One or more jobs failed:"
echo '${{ toJSON(needs) }}'
exit 1
- run: echo "All checks passed."