-
Notifications
You must be signed in to change notification settings - Fork 0
165 lines (131 loc) · 4.49 KB
/
Copy pathci.yml
File metadata and controls
165 lines (131 loc) · 4.49 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
env:
PYTHON_VERSION: "3.12"
jobs:
lint:
name: Format and lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install ruff
run: pipx install ruff==0.16.3
- name: Check formatting
run: ruff format --check .
- name: Lint
run: ruff check --output-format=github .
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v7
with:
node-version: 22
cache: pnpm
- name: Install the formatter
run: pnpm install --frozen-lockfile --ignore-scripts
- name: Check that every JSON file is formatted
run: pnpm run format:check
- name: Lint the workflows
uses: raven-actions/actionlint@v2
- name: Lint the shell scripts
run: |
sudo apt-get update
sudo apt-get install -y shellcheck
shellcheck --severity=style --shell=bash scripts/*.sh
types:
name: Types
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install the type checker
run: pipx install mypy==1.14.1
# Strict, with every optional error class the version offers. This is address
# arithmetic end to end, so a bank or an offset crossing a boundary it should
# not is exactly what a checker is for. Settings live in pyproject.toml so a
# local run and this one agree.
- name: Every annotation has to hold
run: mypy
test:
name: Tests on Python ${{ matrix.python }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: ["3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python }}
- name: Install coverage
run: python -m pip install --disable-pip-version-check coverage==7.6.10
- name: Run every test file, under coverage
run: |
python -m coverage erase
status=0
while IFS= read -r file; do
echo "::group::${file}"
python -m coverage run -a "${file}" || status=1
echo "::endgroup::"
done < <(find mapper conformance -name '*.test.py' | sort)
exit "${status}"
shell: bash
- name: Coverage must be total
run: python -m coverage report
# No document is redistributable, so none is here and this checks nothing
# on a runner. It says so rather than reporting a pass: the value is that
# somebody running it with the manual on disk gets a real answer, and that
# a run without it cannot be mistaken for one.
- name: Every quoted sentence, against the document it came from
run: python -m conformance.quotes
speed:
name: Throughput
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: The map must still answer faster than the floor
run: python -m conformance.speed
conformance:
name: Corpus
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Replay every header combination the corpus recorded
run: python -m conformance.corpus
cartridges:
name: Cartridges
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Read every cartridge present
run: |
status=0
python -m conformance.against_cartridges || status="$?"
if [ "${status}" -eq 2 ]; then
echo "::notice title=Cartridges::No cartridge is present on a hosted runner, so this sweep was skipped rather than passed. It reads the header of every retail cartridge in the library and holds each one to the recorded corpus. Run it locally with a library you own, or point SNES_CARTRIDGE_DIR at one."
exit 0
fi
exit "${status}"
shell: bash