-
Notifications
You must be signed in to change notification settings - Fork 0
ci: Add workflow for build and test #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| name: Build & Test | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| env: | ||
| CARGO_TERM_COLOR: always | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install Rust toolchain | ||
| uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| components: clippy, rustfmt | ||
|
|
||
| - name: Build | ||
| run: cargo build --all-targets | ||
|
|
||
| - name: Run tests | ||
| run: cargo test --all-targets | ||
|
|
||
| - name: Run clippy | ||
| run: cargo clippy --all-targets -- -D warnings | ||
|
|
||
| - name: Check formatting | ||
| run: cargo fmt --all -- --check | ||
|
|
||
| example: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
||
|
|
||
| - name: Install Rust toolchain | ||
| uses: dtolnay/rust-toolchain@stable | ||
|
|
||
| - name: Run example | ||
| run: cargo run --package confuzzled_lib --example basic | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding Cargo dependency caching to speed up CI runs. Without caching, all dependencies will be recompiled on every workflow run, which can significantly increase build times. You can add a caching step after checkout using actions/cache or the Swatinem/rust-cache action which is specifically designed for Rust projects and handles caching of the target directory and Cargo registry automatically.