Repository navigation
Behaviour blocks: conditions, effects, counters and Lua signals in the brain #133
Workflow file for this run
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
| # SPDX-License-Identifier: MIT | |
| # SPDX-FileCopyrightText: 2026 sp00ktober | |
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| permissions: | |
| contents: read | |
| # every job has a time limit: a hung one otherwise runs for six hours on the minutes budget | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: astral-sh/setup-uv@v10.2.0 | |
| with: | |
| enable-cache: true | |
| - uses: actions/cache@v6 | |
| with: | |
| path: ~/.cache/pre-commit | |
| key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} | |
| - run: uv sync --locked | |
| - run: uv run pre-commit run --all-files --show-diff-on-failure | |
| test: | |
| strategy: | |
| matrix: | |
| python: ["3.11", "3.14"] | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: astral-sh/setup-uv@v10.2.0 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| enable-cache: true | |
| # Mesa for the studio's GL tests; X11 headers because glcontext has no wheel for 3.14 | |
| - run: sudo apt-get update && sudo apt-get install -y libegl1 libegl-mesa0 libgl1 libgl1-mesa-dri libx11-dev | |
| # no Qt tests here: no display and none of Qt's system libraries (they skip) | |
| - run: uv sync --locked --no-group qt | |
| - run: uv run --no-group qt pytest | |
| # the Lua that ships against the mhfu API it declares (framework/lua/meta/mhfu.d.lua) | |
| lua: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| env: | |
| LUALS: 3.19.1 | |
| LUALS_SHA256: e9235d2d72ef55bc41cf8c99cda2ed64777682024b4bb81f5dea425060c5cbb8 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: astral-sh/setup-uv@v10.2.0 | |
| with: | |
| enable-cache: true | |
| - run: uv sync --locked | |
| - run: | | |
| mkdir -p framework/build/gen | |
| uv run python -m mhfu.addresses lua -o framework/build/gen/addresses.gen.lua | |
| - name: lua-language-server --check | |
| run: | | |
| cd "$RUNNER_TEMP" | |
| curl -fsSLo luals.tar.gz "https://github.com/LuaLS/lua-language-server/releases/download/$LUALS/lua-language-server-$LUALS-linux-x64.tar.gz" | |
| echo "$LUALS_SHA256 luals.tar.gz" | sha256sum -c | |
| mkdir luals && tar xzf luals.tar.gz -C luals | |
| luals/bin/lua-language-server --check="$GITHUB_WORKSPACE" --checklevel=Warning --logpath="$RUNNER_TEMP/luals-log" | |
| # advisory until the first release: breaking changes show up as annotations on the PR | |
| api: | |
| if: github.event_name == 'pull_request' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - uses: astral-sh/setup-uv@v10.2.0 | |
| - name: griffe check against the base branch | |
| continue-on-error: true | |
| run: | | |
| base=origin/${{ github.base_ref }} | |
| status=0 | |
| for init in packages/*/src/*/__init__.py; do | |
| git cat-file -e "$base:$init" 2>/dev/null || continue # new package | |
| module=${init%/__init__.py} | |
| uvx griffe@2.3.0 check "${module##*/}" -s "${module%/*}" -a "$base" -f github || status=1 | |
| done | |
| exit $status |