Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 31 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@ env:
MACOSX_DEPLOYMENT_TARGET: "11.0"

jobs:
check:
name: Check
# macos-15 is arm64, so the host target is the only one gbat ships.
runs-on: macos-15
validate:
name: Validate (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [macos-15, ubuntu-24.04]
runs-on: ${{ matrix.os }}
timeout-minutes: 15
steps:
- name: Check out source
Expand All @@ -30,10 +33,34 @@ jobs:

# rustup installs the toolchain pinned in rust-toolchain.toml on first use.
- name: Format
if: runner.os == 'macOS'
run: cargo fmt --check

- name: Lint
run: cargo clippy --all-targets --locked -- -D warnings

- name: Test
run: cargo test --locked

# Linux is installed from source; verify linking and startup without HID access.
- name: Build and smoke-test Linux CLI
if: runner.os == 'Linux'
run: |
set -euo pipefail
cargo build --release --locked
version="$(sed -n 's/^version = "\([^"]*\)"/\1/p' Cargo.toml | head -n 1)"
test -n "$version"
test "$(./target/release/gbat --version)" = "gbat $version"

check:
name: Check
# Keep the existing required check, and fail even if validation was skipped.
if: always()
needs: validate
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- name: Require both platforms to pass
env:
VALIDATION_RESULT: ${{ needs.validate.result }}
run: test "$VALIDATION_RESULT" = success
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ env:
jobs:
build:
name: Build aarch64-apple-darwin
# macos-15 is arm64, so a native build produces the only target gbat ships.
# macos-15 is arm64; release archives remain macOS-only. Linux is built from source.
runs-on: macos-15
timeout-minutes: 30
env:
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ For an authorized PR merge, wait for the checks required by the current GitHub b

Once those requirements are satisfied, proceed with the merge while optional checks such as CodeQL continue asynchronously. Report optional checks that are still pending as pending, and investigate any known failures or security findings rather than describing the entire CI run as successful. Wait for all checks when the user explicitly requests that scope.

Keep PR validation in a single macOS job running formatting, Clippy, and tests. Keep CodeQL enabled as an asynchronous check; add caching or parallel jobs only when measured runtime justifies their overhead.
Validate PRs natively on macOS and Linux so platform-specific code and HID backends are checked. Keep Clippy and tests together in each platform job, run formatting once, and preserve `Check` as the required aggregate gate that passes only when both platforms succeed. Keep CodeQL enabled as an asynchronous check; add caching or further job splitting only when measured runtime justifies their overhead.

## Versioning

Expand Down
Loading