Repository navigation
CI and the release install from the lockfile exactly #311
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ci | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| jobs: | |
| commits: | |
| # A commit message is published text too: the commits this push or pull request adds name no one | |
| # inside the team and point at no internal room or tracker, like the tree. | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - run: python3 scripts/public_words.py --commits "$RANGE" | |
| env: | |
| RANGE: ${{ github.event_name == 'pull_request' && format('{0}..{1}', github.event.pull_request.base.sha, github.event.pull_request.head.sha) || (github.event.before && !startsWith(github.event.before, '0000000') && format('{0}..{1}', github.event.before, github.sha)) || github.sha }} | |
| gates: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| # 3.12 is the oldest Python pyproject.toml admits; each newer minor is tested too. | |
| python: ['3.12', '3.13', '3.14'] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| - run: uv sync --locked | |
| - run: uv run python --version | |
| - run: uv run pytest -q | |
| - run: uv run ruff check . | |
| - run: uv run ruff format --check . | |
| - run: uv run mypy --strict src tests | |
| - run: uv run python codegen/generate_schema.py --check | |
| - run: uv run python codegen/generate_tools.py --check | |
| - run: uv run python codegen/generate_anchors.py --check | |
| - run: uv run python codegen/generate_directions.py --check | |
| # Published text names no one inside the team and points at no internal room or tracker. | |
| - run: uv run python scripts/public_words.py | |
| okf-reference: | |
| # OKF's own parser and viewer, at the commit onlyworlds.okf pins, read this package's export. | |
| # tests/test_okf.py skips that check when OKF's code is not importable, so the gates above | |
| # never run it. Here the code is fetched at the pinned commit and a skip is a failure. | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: astral-sh/setup-uv@v7 | |
| - run: uv sync --locked | |
| - name: OKF's reference code at the pinned commit | |
| run: | | |
| REPO=$(uv run python -c "from onlyworlds import okf; print(okf.OKF_REPO)") | |
| COMMIT=$(uv run python -c "from onlyworlds import okf; print(okf.OKF_COMMIT)") | |
| echo "$REPO at $COMMIT" | |
| git init -q "$RUNNER_TEMP/okf" | |
| git -C "$RUNNER_TEMP/okf" fetch -q --depth 1 "$REPO" "$COMMIT" | |
| git -C "$RUNNER_TEMP/okf" checkout -q FETCH_HEAD | |
| test "$(git -C "$RUNNER_TEMP/okf" rev-parse HEAD)" = "$COMMIT" | |
| - name: The reference check, where a skip fails | |
| env: | |
| OKF_REFERENCE_SRC: ${{ runner.temp }}/okf/src | |
| run: | | |
| uv run pytest -q -rs tests/test_okf.py::test_reference_parser_and_viewer | tee "$RUNNER_TEMP/okf.txt" | |
| grep -q -E '^1 passed' "$RUNNER_TEMP/okf.txt" | |
| wire: | |
| # keel's own OpenAPI document and the public demo world, read only, and a few writes to the | |
| # practice world (its published key, reset every night), each deleted again. Red here with | |
| # the gates above green means the server moved under the client, not that a change broke it. | |
| runs-on: ubuntu-latest | |
| env: | |
| OW_OPENAPI: https://www.onlyworlds.com/api/v2/openapi.json | |
| OW_LIVE: "1" | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: astral-sh/setup-uv@v7 | |
| - run: uv sync --locked | |
| - run: uv run pytest -q tests/test_wire.py tests/test_live.py tests/test_live_practice.py |