Repository navigation
ci: add CI and release workflows - #1
Conversation
Adds standard CI (build + test on linux/mac/windows, clippy, rustfmt) and release (cross-compile + attach binaries to GH release on tag push). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
👋 CorvidAgent is looking into this. |
corvid-agent
left a comment
There was a problem hiding this comment.
Looks good — clean CI/CD setup. A few minor observations:
CI (ci.yml)
- The
checkjob usescargo build --releasewhich is slower than a debug build. For CI purposes a plaincargo buildwould catch the same compilation errors faster. Reserve--releasefor the release workflow. - Lint-only-on-ubuntu is the right call since clippy/fmt results are platform-independent.
Release (release.yml)
- No test step before building artifacts. If a tag lands on a broken commit, you'd ship broken binaries. Consider either adding
cargo testbefore the build step, or requiring CI to pass on the tagged commit (e.g., via branch protection on main + only tagging from main). x86_64-apple-darwinonmacos-latest(ARM runner) relies on cross-compilation — should work fine since the target is explicitly installed viadtolnay/rust-toolchain, but worth a sanity check on the first release.
Source changes — purely cargo fmt, no logic changes. ✅
Overall solid. Approving — the suggestions above are minor improvements, not blockers.
There was a problem hiding this comment.
Code Review
This pull request primarily focuses on code formatting within src/main.rs, including expanding the Kind::all array to multiple lines and condensing a timeout calculation and a test assertion into single lines. A review comment suggests using assert_eq! instead of assert!(matches!(...)) in the test suite to improve the clarity of error messages during failures.
| game.board[(H - 1) as usize][0], | ||
| Some(Kind::T) | ||
| )); | ||
| assert!(matches!(game.board[(H - 1) as usize][0], Some(Kind::T))); |
There was a problem hiding this comment.
In tests, using assert_eq! is generally preferred over assert!(matches!(...)) for simple equality checks. assert_eq! provides more descriptive error messages by displaying both the actual and expected values upon failure, which is particularly helpful when debugging CI failures in a headless environment.
| assert!(matches!(game.board[(H - 1) as usize][0], Some(Kind::T))); | |
| assert_eq!(game.board[(H - 1) as usize][0], Some(Kind::T)); |
CI runs clippy 1.95 which enables `collapsible_match`; locally the lint was satisfied by older toolchains. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
.github/workflows/ci.yml— build + test on Linux/macOS/Windows, clippy with -D warnings, rustfmt --check.github/workflows/release.yml— cross-compile binaries on tag push, attach to GitHub releasecargo fmtto make the lint job passTest plan
🤖 Generated with Claude Code