From 9e8ea0dd2ed6b54b2549098cb99435df1b26345d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niko=20H=C3=A4m=C3=A4l=C3=A4inen?= Date: Sat, 29 Aug 2026 21:42:07 +0300 Subject: [PATCH] Run the root checks as parallel steps in one job Each root check had a job of its own through the generic mise-task.yaml wrapper, which was the only way to run them concurrently. Measured over six successful runs on main, those eight jobs spent about 103s restoring the same tools to run 5s of checks: a job is a fresh VM, so the same image boot, checkout and cache restore was paid eight times over. GitHub Actions gained parallel steps on 2026-06-25, which run concurrently inside one job while still reporting per-step status. Move the eight checks into a single job, so the setup is paid once. A failing step is still attributed individually, and its siblings still run, so nothing is lost by no longer having a job per check. ruff keeps its cache in the working directory, so check:ruff and check:ruff:format would now share one .ruff_cache. Point them at separate cache directories under the runner temp instead. --- .github/workflows/checks-mise.yaml | 67 ++++++++++++++++++++++++++++++ .github/workflows/ci.yaml | 67 ++---------------------------- 2 files changed, 71 insertions(+), 63 deletions(-) create mode 100644 .github/workflows/checks-mise.yaml diff --git a/.github/workflows/checks-mise.yaml b/.github/workflows/checks-mise.yaml new file mode 100644 index 0000000..060c6fd --- /dev/null +++ b/.github/workflows/checks-mise.yaml @@ -0,0 +1,67 @@ +name: Checks - mise tools +on: + workflow_call: + workflow_dispatch: +permissions: + contents: read + +jobs: + # Every check that needs only the tools mise installs + checks: + name: Run checks + runs-on: ubuntu-24.04 + timeout-minutes: 15 + + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + + - name: Restore tools + uses: ./.github/actions/mise-project-setup + with: + directory: . + + - parallel: + - name: check:prettier + + run: mise run check:prettier + shell: bash + + - name: check:pyright-repo + + run: mise run check:pyright-repo + shell: bash + + - name: check:ruff + + env: + RUFF_CACHE_DIR: ${{ runner.temp }}/ruff-cache-check + run: mise run check:ruff + shell: bash + + - name: check:ruff:format + + env: + RUFF_CACHE_DIR: ${{ runner.temp }}/ruff-cache-format + run: mise run check:ruff:format + shell: bash + + - name: check:shellcheck + + run: mise run check:shellcheck + shell: bash + + - name: check:shellcheck-config-enabled-optional-checks + + run: mise run check:shellcheck-config-enabled-optional-checks + shell: bash + + - name: check:shellcheck-gha + + run: mise run check:shellcheck-gha + shell: bash + + - name: check:shfmt + + run: mise run check:shfmt + shell: bash diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 98af7cd..6a5059b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -73,62 +73,10 @@ jobs: concurrency: group: ${{ github.workflow }}-${{ github.ref }}-homebrew-ubuntu - # Checks for root - check-prettier: + # Checks + checks-mise: needs: mise-cache-ubuntu - uses: ./.github/workflows/mise-task.yaml - with: - directory: . - task: check:prettier - - check-pyright-repo: - needs: mise-cache-ubuntu - uses: ./.github/workflows/mise-task.yaml - with: - directory: . - task: check:pyright-repo - - check-ruff: - needs: mise-cache-ubuntu - uses: ./.github/workflows/mise-task.yaml - with: - directory: . - task: check:ruff - - check-ruff-format: - needs: mise-cache-ubuntu - uses: ./.github/workflows/mise-task.yaml - with: - directory: . - task: check:ruff:format - - check-shellcheck: - needs: mise-cache-ubuntu - uses: ./.github/workflows/mise-task.yaml - with: - directory: . - task: check:shellcheck - - check-shellcheck-config-enabled-optional-checks: - needs: mise-cache-ubuntu - uses: ./.github/workflows/mise-task.yaml - with: - directory: . - task: check:shellcheck-config-enabled-optional-checks - - check-shellcheck-gha: - needs: mise-cache-ubuntu - uses: ./.github/workflows/mise-task.yaml - with: - directory: . - task: check:shellcheck-gha - - check-shfmt: - needs: mise-cache-ubuntu - uses: ./.github/workflows/mise-task.yaml - with: - directory: . - task: check:shfmt + uses: ./.github/workflows/checks-mise.yaml # CI workflows for projects in the repository ci-aoc-main: @@ -178,14 +126,7 @@ jobs: check: if: always() needs: - - check-prettier - - check-pyright-repo - - check-ruff - - check-ruff-format - - check-shellcheck - - check-shellcheck-config-enabled-optional-checks - - check-shellcheck-gha - - check-shfmt + - checks-mise - ci-aoc-main - ci-solvers-cpp - ci-solvers-python