Skip to content

docs(family): drop a stale count of the members #24

docs(family): drop a stale count of the members

docs(family): drop a stale count of the members #24

Workflow file for this run

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@v5
- uses: actions/setup-python@v6
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@v6
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
types:
name: Types
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install mypy
run: pipx install mypy==1.14.1
# Strict, with every optional error class the checker offers. The
# configuration lives in pyproject.toml so this run and a local one are
# the same run.
- name: Check types
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@v5
- uses: actions/setup-python@v6
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 spc700 conformance -name '*.test.py' | sort)
exit "${status}"
shell: bash
- name: Coverage must be total
run: python -m coverage report
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 core must still run faster than the floor
run: python -m conformance.speed
quotes:
name: Every quoted sentence, against the document it came from
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: ${{ env.PYTHON_VERSION }}
# The manual is not redistributable, so it is not 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
conformance:
name: Conformance against SingleStepTests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Read the pinned suite commit
id: pin
run: |
commit=$(python -c "import json,pathlib;print(json.loads(pathlib.Path('conformance/suites.json').read_text())['suites'][0]['commit'])")
echo "commit=${commit}" >> "${GITHUB_OUTPUT}"
- name: Cache the suite
id: cache
uses: actions/cache@v6
with:
path: ~/.cache/conformance-suites
key: suites-${{ steps.pin.outputs.commit }}
- name: Fetch the suite
if: steps.cache.outputs.cache-hit != 'true'
run: python -m conformance.fetch ~/.cache/conformance-suites
# A pull request runs a tenth of each file for a quick answer. A push to
# main runs all 256,000 cases, because that is the number both claims rest
# on.
#
# Both runners, always. The state comparison asks what the registers and
# memory hold afterwards; the cycle comparison asks what happened on the
# bus. A core can pass either one while failing the other, and a store
# that reads its destination is invisible to the first.
- name: Run the suite
run: |
if [ "${GITHUB_EVENT_NAME}" = "pull_request" ]; then
limit=100
else
limit=0
fi
python -m conformance.singlestep \
~/.cache/conformance-suites/spc700/spc700/v1 "${limit}"
python -m conformance.cycles \
~/.cache/conformance-suites/spc700/spc700/v1 "${limit}"
shell: bash