Refactor CI workflow for improved build and test processes #14
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
name: Rust CI | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
workflow_dispatch: | |
env: | |
CARGO_TERM_COLOR: always | |
permissions: | |
contents: read | |
pull-requests: write | |
jobs: | |
build_and_test: | |
name: Build Rust - latest | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
toolchain: | |
- stable | |
- beta | |
- nightly | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Update rust and set default toolchain | |
run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} | |
- name: Build | |
run: cargo build --verbose | |
- name: Run tests | |
run: cargo test --verbose | |
latest_deps: | |
name: Latest Dependencies | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
env: | |
CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS: allow | |
steps: | |
- uses: actions/checkout@v4 | |
- run: rustup update stable && rustup default stable | |
- run: cargo update --verbose | |
- run: cargo build --verbose | |
- run: cargo test --verbose |