From a2a1f60552cbffec92aca68ac44909a454a3f3ce Mon Sep 17 00:00:00 2001 From: John Vandenberg Date: Wed, 8 Apr 2026 10:56:38 +0800 Subject: [PATCH 1/8] Add CI check workflow --- .github/workflows/check.yml | 35 +++++++++++++++++++++++++++++++++++ .mise.toml | 4 ++++ 2 files changed, 39 insertions(+) create mode 100644 .github/workflows/check.yml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..050b1b9 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,35 @@ +--- +name: check + +"on": + pull_request: + +permissions: + id-token: write + contents: write + +jobs: + pre-commit: + runs-on: ubuntu-latest + timeout-minutes: 25 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install mise + uses: taiki-e/install-action@v2 + with: + tool: mise + + - name: Install mise checker tools + run: | + mise settings add idiomatic_version_file_enable_tools "[]" + mise install grex + env: + GITHUB_TOKEN: ${{ github.token }} + + - name: Run checkers + run: | + mise run check diff --git a/.mise.toml b/.mise.toml index bb64685..78be4d0 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,4 +1,5 @@ [tools] +action-validator = "latest" "cargo:taplo-cli" = "latest" "cargo:wasm-pack" = "latest" "chromedriver" = "146" @@ -14,6 +15,9 @@ protoc = "latest" rust = "latest" typos = "latest" +# grex is just a convenient way to depends on all of the checker tools at once +grex = { depends = ["rust", "dprint", "editorconfig-checker", "cargo:taplo-cli", "typos", "osv-scanner"], "version" = "latest" } + [tasks] dprint-check = "dprint check" dprint-fmt = "dprint fmt" From 9cc47e5c6bd385b55df77e77319d85ba3905f519 Mon Sep 17 00:00:00 2001 From: John Vandenberg Date: Wed, 8 Apr 2026 10:57:42 +0800 Subject: [PATCH 2/8] run check on push --- .github/workflows/check.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 050b1b9..54cbe9d 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -3,6 +3,8 @@ name: check "on": pull_request: + push: + # TODO: remove this after the workflow is verified to work on pull requests permissions: id-token: write From 88540126a73e98be113f23f1b08de8e73f44b7ca Mon Sep 17 00:00:00 2001 From: John Vandenberg Date: Wed, 8 Apr 2026 11:20:03 +0800 Subject: [PATCH 3/8] fixes --- .github/workflows/check.yml | 2 +- .mise.toml | 22 +++++++++++++++++++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 54cbe9d..f47a14e 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -11,7 +11,7 @@ permissions: contents: write jobs: - pre-commit: + check: runs-on: ubuntu-latest timeout-minutes: 25 steps: diff --git a/.mise.toml b/.mise.toml index 78be4d0..aa5aebe 100644 --- a/.mise.toml +++ b/.mise.toml @@ -16,7 +16,15 @@ rust = "latest" typos = "latest" # grex is just a convenient way to depends on all of the checker tools at once -grex = { depends = ["rust", "dprint", "editorconfig-checker", "cargo:taplo-cli", "typos", "osv-scanner"], "version" = "latest" } +grex = { depends = [ + "cargo:taplo-cli", + "dprint", + "editorconfig-checker", + "osv-scanner", + "rust", + "rust@nightly", + "typos", +], "version" = "latest" } [tasks] dprint-check = "dprint check" @@ -27,17 +35,23 @@ editorconfig-check = "ec" depends = ["cargo-fmt", "dprint-fmt", "taplo-fmt"] description = "Run repository formatters" -[tasks.check] +[tasks.check-phase-1] depends = [ "cargo-check", "cargo-clippy", "cargo-fmt-check", "dprint-check", "editorconfig-check", - "osv-scanner", "taplo-check", "typos", ] +description = "Run repository checks (phase 1: even if no Cargo.lock exists)" + +[tasks.check] +depends = [ + "check-phase-1", + "osv-scanner", +] description = "Run repository checks" [tasks.cargo-check] @@ -45,9 +59,11 @@ run = "cargo check --workspace" [tasks.cargo-fmt] run = "cargo +nightly fmt" +tools.rust = "nightly" [tasks.cargo-fmt-check] run = "cargo +nightly fmt -- --check" +tools.rust = "nightly" [tasks.cargo-clippy] run = "cargo clippy --workspace" From 7667e02b01eaeac55dc0e4d18d94c412e9ce033a Mon Sep 17 00:00:00 2001 From: John Vandenberg Date: Wed, 8 Apr 2026 12:07:38 +0800 Subject: [PATCH 4/8] more depends --- .mise.toml | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/.mise.toml b/.mise.toml index aa5aebe..c34ae5a 100644 --- a/.mise.toml +++ b/.mise.toml @@ -12,7 +12,7 @@ osv-scanner = "latest" pipx = "latest" "pipx:cmake" = "latest" protoc = "latest" -rust = "latest" +rust = { version = "latest", components = "clippy" } typos = "latest" # grex is just a convenient way to depends on all of the checker tools at once @@ -35,35 +35,47 @@ editorconfig-check = "ec" depends = ["cargo-fmt", "dprint-fmt", "taplo-fmt"] description = "Run repository formatters" +[tasks.install-nightly] +run = "rustup toolchain install nightly --component rustfmt" + + [tasks.check-phase-1] +depends = ["cargo-check", "cargo-clippy", "dprint-check", "editorconfig-check", "taplo-check", "typos"] +description = "Run repository checks (phase 1: even if no Cargo.lock exists)" + +[tasks.check] depends = [ "cargo-check", "cargo-clippy", "cargo-fmt-check", "dprint-check", "editorconfig-check", + "osv-scanner", "taplo-check", "typos", ] -description = "Run repository checks (phase 1: even if no Cargo.lock exists)" - -[tasks.check] -depends = [ - "check-phase-1", - "osv-scanner", -] description = "Run repository checks" [tasks.cargo-check] run = "cargo check --workspace" [tasks.cargo-fmt] +depends = ["install-nightly"] run = "cargo +nightly fmt" -tools.rust = "nightly" + +# Not accepted per https://mise.jdx.dev/tasks/task-configuration.html : + +#[tasks.cargo-fmt.tools.rust] +#version = "nightly" +#components = "rustfmt" [tasks.cargo-fmt-check] +depends = ["install-nightly"] run = "cargo +nightly fmt -- --check" -tools.rust = "nightly" + +#[tasks.cargo-fmt-check.tools.rust] +#version = "nightly" +#components = "rustfmt" [tasks.cargo-clippy] run = "cargo clippy --workspace" @@ -78,6 +90,7 @@ run = "taplo lint" run = "typos" [tasks.osv-scanner] +depends = ["cargo-check"] run = "osv-scanner --lockfile Cargo.lock" [tasks.ws-server] From c48ad4a795f1cad2c94359147fcc44e220244259 Mon Sep 17 00:00:00 2001 From: John Vandenberg Date: Wed, 8 Apr 2026 12:13:30 +0800 Subject: [PATCH 5/8] remove grex --- .github/workflows/check.yml | 4 ++-- .mise.toml | 16 ---------------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index f47a14e..0ca7d7b 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -25,10 +25,10 @@ jobs: with: tool: mise - - name: Install mise checker tools + - name: Install mise tools run: | mise settings add idiomatic_version_file_enable_tools "[]" - mise install grex + mise install env: GITHUB_TOKEN: ${{ github.token }} diff --git a/.mise.toml b/.mise.toml index c34ae5a..8b11bdb 100644 --- a/.mise.toml +++ b/.mise.toml @@ -15,17 +15,6 @@ protoc = "latest" rust = { version = "latest", components = "clippy" } typos = "latest" -# grex is just a convenient way to depends on all of the checker tools at once -grex = { depends = [ - "cargo:taplo-cli", - "dprint", - "editorconfig-checker", - "osv-scanner", - "rust", - "rust@nightly", - "typos", -], "version" = "latest" } - [tasks] dprint-check = "dprint check" dprint-fmt = "dprint fmt" @@ -38,11 +27,6 @@ description = "Run repository formatters" [tasks.install-nightly] run = "rustup toolchain install nightly --component rustfmt" - -[tasks.check-phase-1] -depends = ["cargo-check", "cargo-clippy", "dprint-check", "editorconfig-check", "taplo-check", "typos"] -description = "Run repository checks (phase 1: even if no Cargo.lock exists)" - [tasks.check] depends = [ "cargo-check", From 9bfc8e668b5956e86dff34b96faf88f367988d3c Mon Sep 17 00:00:00 2001 From: John Vandenberg Date: Wed, 8 Apr 2026 12:14:39 +0800 Subject: [PATCH 6/8] undo running this on pushes --- .github/workflows/check.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 0ca7d7b..3f1e849 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -3,8 +3,6 @@ name: check "on": pull_request: - push: - # TODO: remove this after the workflow is verified to work on pull requests permissions: id-token: write From 2f165273d0172b6c64c44bfdc645f4aeb434a71a Mon Sep 17 00:00:00 2001 From: John Vandenberg Date: Wed, 8 Apr 2026 12:17:40 +0800 Subject: [PATCH 7/8] concurrency --- .github/workflows/check.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 3f1e849..e680f0c 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -3,11 +3,17 @@ name: check "on": pull_request: + workflow_dispatch: permissions: id-token: write contents: write +# this allows a subsequently queued workflow run to interrupt previous runs in pull requests only +concurrency: + group: "${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} + jobs: check: runs-on: ubuntu-latest From 4cf2c03d8ff20222adc1b235cc3299f692480880 Mon Sep 17 00:00:00 2001 From: John Vandenberg Date: Wed, 8 Apr 2026 12:19:12 +0800 Subject: [PATCH 8/8] remove comments --- .mise.toml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.mise.toml b/.mise.toml index 8b11bdb..1441162 100644 --- a/.mise.toml +++ b/.mise.toml @@ -47,20 +47,10 @@ run = "cargo check --workspace" depends = ["install-nightly"] run = "cargo +nightly fmt" -# Not accepted per https://mise.jdx.dev/tasks/task-configuration.html : - -#[tasks.cargo-fmt.tools.rust] -#version = "nightly" -#components = "rustfmt" - [tasks.cargo-fmt-check] depends = ["install-nightly"] run = "cargo +nightly fmt -- --check" -#[tasks.cargo-fmt-check.tools.rust] -#version = "nightly" -#components = "rustfmt" - [tasks.cargo-clippy] run = "cargo clippy --workspace"