Repository navigation
111 lines (104 loc) · 3.39 KB
/
Copy pathci.yml
File metadata and controls
111 lines (104 loc) · 3.39 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
100
101
102
103
104
105
106
107
108
109
110
111
name: CI
on:
push:
branches: [main]
pull_request:
# the Deck model workflow dispatches CI on the pull request it opens
workflow_dispatch:
workflow_call:
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: pyproject.toml
- uses: Swatinem/rust-cache@v2
with:
workspaces: rust
- uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Install (builds the extension module nnnotes._deck)
run: uv pip install --system -e ".[test]" boto3
- name: Lint
run: python -m pyflakes src tests
- name: Command line
run: python -m nnnotes --help
- name: Test
run: python -m pytest
workflows:
# the publishing scripts with the nnnotes release they install (.github/nnnotes.txt)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.13"
- uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Install nnnotes
run: uv pip install --system -r .github/nnnotes.txt boto3 pytest jsonschema
- uses: actions/setup-node@v7
with:
node-version: "22"
- name: Chart data page
env:
PLAYER_REPOSITORY: ${{ vars.MUSIC_DATA_PLAYER_REPOSITORY || 'empty-sekai/ournotes-player' }}
PLAYER_REF: ${{ vars.MUSIC_DATA_PLAYER_REF }}
run: .github/scripts/songs_page.sh "$RUNNER_TEMP/music-data-player"
- name: Workflow tests
env:
MUSIC_DATA_PAGE: ${{ format('{0}/music-data-player/examples/songs', runner.temp) }}
run: python -m pytest -q .github/scripts
goldens:
# The golden records of the stages (tests/golden/*.json) were made with these library versions; with the same
# versions installed an output change without a stage or converter version bump fails instead of being skipped.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.13"
cache: pip
cache-dependency-path: |
pyproject.toml
.github/goldens-constraints.txt
- uses: Swatinem/rust-cache@v2
with:
workspaces: rust
- uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Install (pinned)
run: uv pip install --system -c .github/goldens-constraints.txt -e ".[test]"
- name: Golden records
env:
GOLDENS_STRICT: "1"
run: python -m pytest tests/test_goldens.py tests/test_objexport.py
rust:
# the extension module's own code (rust/); ournotes-deck is tested in its repository
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: Swatinem/rust-cache@v2
with:
workspaces: rust
- name: Format and lints
working-directory: rust
run: |
cargo fmt --check
cargo clippy --locked --all-targets -- -D warnings