-
-
Notifications
You must be signed in to change notification settings - Fork 339
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* validate that the rustutils crate is valid * currently uses hardcoded CI script, but should move it all to justfile similar to many other similar crates * add MSRV (tested with `cargo msrv find` + CI for it * ensure rustutils crate is not published, and set version to 0.0.0 as it has no internal version
- Loading branch information
Showing
3 changed files
with
83 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: rust-ci | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
workflow_dispatch: | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: rustutils/ | ||
|
||
jobs: | ||
test: | ||
name: Rust tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: Swatinem/rust-cache@v2 | ||
if: github.event_name != 'release' && github.event_name != 'workflow_dispatch' | ||
- name: Test rustutils | ||
run: | | ||
# Eventually this script should be moved to a justfile as a "ci-test" recipe | ||
# rust-info: | ||
rustc --version | ||
cargo --version | ||
# | ||
# Test code formatting | ||
# test-fmt: | ||
cargo fmt --all -- --check | ||
# | ||
# Run cargo clippy | ||
# clippy: | ||
cargo clippy --workspace --all-targets -- -D warnings | ||
# | ||
# Quick compile | ||
# check: | ||
RUSTFLAGS='-D warnings' cargo check --workspace --all-targets | ||
# | ||
# Run all tests | ||
# test: | ||
cargo test --workspace --all-targets | ||
# | ||
# Test documentation | ||
# test-doc: | ||
RUSTDOCFLAGS="-D warnings" cargo doc --no-deps | ||
msrv: | ||
name: Rust tests MSRV | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: Swatinem/rust-cache@v2 | ||
if: github.event_name != 'release' && github.event_name != 'workflow_dispatch' | ||
- name: Read crate metadata | ||
id: metadata | ||
run: echo "rust-version=$(sed -ne 's/rust-version *= *\"\(.*\)\"/\1/p' Cargo.toml)" >> $GITHUB_OUTPUT | ||
- name: Install Rust | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: ${{ steps.metadata.outputs.rust-version }} | ||
components: rustfmt | ||
- name: Test rustutils | ||
working-directory: rustutils/ | ||
run: | | ||
# Eventually this script should be moved to a justfile as a "ci-test-msrv" recipe | ||
# rust-info: | ||
rustc --version | ||
cargo --version | ||
# | ||
# Quick compile | ||
# check: | ||
RUSTFLAGS='-D warnings' cargo check --workspace --all-targets | ||
# | ||
# Run all tests | ||
# test: | ||
cargo test --workspace --all-targets |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters