From aaf68e9a598c8ebaec96bebeefdd9e426b1cc81e Mon Sep 17 00:00:00 2001 From: Jacob Atchley Date: Thu, 24 Sep 2026 15:55:44 -0500 Subject: [PATCH] ci: gate pull requests on fmt, clippy, and tests Co-Authored-By: Claude Opus 5.5 (1M context) --- .github/workflows/ci.yml | 35 +++++++++++++++++++++++++++++++++++ README.md | 4 ++++ justfile | 6 ++++++ 3 files changed, 45 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..6d8dfeb --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,35 @@ +name: CI + +on: + pull_request: + branches: [main] + push: + branches: [main] + +# A newer push to the same PR cancels the run for the older commit. +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + # Job names `test (ubuntu-latest)` and `test (macos-latest)` are the + # required status checks in the `main` ruleset; keep them in sync. + test: + name: test (${{ matrix.os }}) + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt, clippy + - uses: Swatinem/rust-cache@v2 + - name: Format + run: cargo fmt --all --check + - name: Clippy + run: cargo clippy --workspace --all-targets -- -D warnings + - name: Test + run: cargo test --workspace diff --git a/README.md b/README.md index 25c8b5b..9473a73 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,12 @@ Custom [herdr](https://herdr.dev) plugins, built and linked from one repo. just # build every plugin and link it with herdr just test # run all tests just dev-one command-palette # build + link one plugin +just ci # fmt + clippy + tests, same as the PR gate ``` +Pull requests into `main` must pass CI (`.github/workflows/ci.yml`: fmt, +clippy with warnings denied, and tests on Linux and macOS) before merging. + herdr launches plugin commands fresh each time, so after `just` the next invocation uses the new build. Relinking is safe; it refreshes the manifest. diff --git a/justfile b/justfile index ae8b9f8..6733790 100644 --- a/justfile +++ b/justfile @@ -15,3 +15,9 @@ dev-one name: (build name) (link name) # Run every test in the cargo workspace. test: cargo test --workspace + +# Run the same checks as the CI gate on pull requests. +ci: + cargo fmt --all --check + cargo clippy --workspace --all-targets -- -D warnings + cargo test --workspace