-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (82 loc) · 2.4 KB
/
python.yml
File metadata and controls
99 lines (82 loc) · 2.4 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Notebooks
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
test:
name: test
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version:
- "3.11"
- "3.12"
- "3.13"
os:
- ubuntu-latest
- windows-latest
- macos-latest
language:
- ja
- en
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Install Task
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ github.token }}
- name: Set up Python
run: uv python install ${{ matrix.python-version }}
- name: Install the project
run: uv sync --extra dev --refresh
- name: Check books
run: task check_book_${{ matrix.language }}
disallow_unreleased:
name: Disallow unreleased release notes
runs-on: ubuntu-latest
if: github.event_name == 'push' && contains(github.ref, 'refs/heads/main') || github.event_name == 'pull_request' && github.base_ref == 'main'
steps:
- uses: actions/checkout@v4
- name: Check unreleased release notes
run: |
if [[ -f ./docs/en/releases/unreleased.ipynb || -f ./docs/ja/releases/unreleased.ipynb ]]; then
echo "[ERROR] Unreleased release notes found!" >&2;
exit 1;
fi
- name: Check if `unreleased` is not in TOC
run: |
for LANG in ja en ; do
TOC=docs/${LANG}/_toc.yml
if yq e '.parts[-1].chapters[]?.file' "${TOC}" | grep -q '^releases/unreleased$' ; then
echo "[ERROR] 'unreleased' found in ${TOC}!" >&2;
exit 1;
fi
done
check_paired_notebooks:
name: check paired notebooks
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.11"
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Install Task
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ github.token }}
- name: Setup Python
run: uv python install ${{ matrix.python-version }}
- name: Install the project
run: uv sync --extra dev --refresh
- name: Check paired notebooks
run: task check_paired_notebooks