Dev #50
Workflow file for this run
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: | |
env: | |
CARGO_TERM_COLOR: always | |
CARGO_INCREMENTAL: 0 | |
# See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency. | |
# This will ensure that only one commit will be running tests at a time on each PR. | |
concurrency: | |
group: ${{ github.ref }}-${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
check: | |
strategy: | |
matrix: | |
rust: ["stable", "nightly"] | |
#os: [ubuntu-latest, macos-latest, windows-2019] | |
# TEMPORARY CHANGE until better solution with shellfish is found | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
- name: Cache Cargo registry | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
key: ${{ runner.os }}-cargo-debug-${{ hashFiles('**/Cargo.toml') }} | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust }} | |
- name: Test Rast library | |
run: cargo +${{ matrix.rust }} test --manifest-path rast/Cargo.toml | |
- name: Test Rast agent | |
run: cargo +${{ matrix.rust }} test --manifest-path rast-agent/Cargo.toml | |
- name: Test Rast C2 | |
run: cargo +${{ matrix.rust }} test --manifest-path rast-c2/Cargo.toml | |
- name: Test Rast CLI | |
run: cargo +${{ matrix.rust }} test --manifest-path rast-cli/Cargo.toml | |
clippy: | |
runs-on: ubuntu-latest | |
needs: ['check'] | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
- name: Cache Cargo registry | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
key: ${{ runner.os }}-cargo-debug-${{ hashFiles('**/Cargo.toml') }} | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@beta | |
with: | |
components: clippy | |
- name: Run clippy | |
run: cargo clippy -- -Dclippy::all -Wclippy::pedantic | |
rustfmt: | |
runs-on: ubuntu-latest | |
needs: ['check'] | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
- name: Cache Cargo registry | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
key: ${{ runner.os }}-cargo-debug-${{ hashFiles('**/Cargo.toml') }} | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: rustfmt | |
- name: Run fmt | |
run: cargo fmt --all -- --check | |
miri: | |
runs-on: ubuntu-latest | |
needs: ['check'] | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
- name: Cache Cargo registry | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
key: ${{ runner.os }}-cargo-debug-${{ hashFiles('**/Cargo.toml') }} | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: miri | |
- name: Setup Miri | |
run: cargo miri setup | |
- name: Run Miri | |
run: cargo miri test | |
machete: | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v3 | |
- name: Cache Cargo registry | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
key: ${{ runner.os }}-cargo-debug-${{ hashFiles('**/Cargo.toml') }} | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@nightly | |
- name: Install Cargo Machete | |
run: cargo install cargo-machete | |
- name: Run Machete | |
run: cargo machete |