Skip to content

Commit

Permalink
Add CI tests for cargo xtask
Browse files Browse the repository at this point in the history
Let's add tests to ensure that the code of our `cargo xtask` tool is
formatted correctly and to ensure that it builds and runs correctly.

We mirrored the details of the current CI configuration of
`calendar-generator`.
  • Loading branch information
traviscross committed Nov 22, 2024
1 parent 0973e0d commit 7638ef9
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
on: [push, pull_request]

name: continuous integration

jobs:
test:
name: test
runs-on: ubuntu-20.04
steps:
- uses: actions/[email protected]
- uses: dtolnay/rust-toolchain@stable
- run: (cd xtask && cargo check --all-features)
- run: (cd xtask && cargo test --release --all-features)
- run: cargo xtask -h
- run: cargo xtask generate-uid -h >/dev/null
- run: test 40 -eq $(cargo xtask generate-uid -n | wc -c)
- run: test 41 -eq $(cargo xtask generate-uid | wc -c)

fmt:
name: rustfmt
runs-on: ubuntu-20.04
steps:
- uses: actions/[email protected]
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: (cd xtask && cargo fmt --all -- --check)

0 comments on commit 7638ef9

Please sign in to comment.