Skip to content

Commit

Permalink
single workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Dzejkop committed Sep 20, 2024
1 parent 8fd409d commit 6bc6828
Showing 1 changed file with 11 additions and 40 deletions.
51 changes: 11 additions & 40 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ env:
RUST_VERSION: 1.81.0

jobs:
lint:
name: Lint
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Rust
run: |
rustup update ${{ env.RUST_VERSION }} && rustup default ${{ env.RUST_VERSION }}
rustup update ${{ env.RUST_VERSION }} && rustup default ${{ env.RUST_VERSION }} && rustup component add rustfmt --toolchain ${{ env.RUST_VERSION }} && rustup component add clippy --toolchain ${{ env.RUST_VERSION }}
- name: Cache Cargo registry
uses: actions/cache@v4
Expand All @@ -40,46 +40,17 @@ jobs:
restore-keys: |
${{ runner.os }}-cargo-build-
- name: Check Formatting
run: cargo fmt --all -- --check
- name: Check
run: cargo check

- name: Run Clippy
run: cargo clippy --features depth_16,depth_20,depth_30
- name: Check (workspace & tests)
run: cargo check --workspace --tests

test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Rust
run: |
rustup update ${{ env.RUST_VERSION }} && rustup default ${{ env.RUST_VERSION }} && rustup component add rustfmt --toolchain ${{ env.RUST_VERSION }} && rustup component add clippy --toolchain ${{ env.RUST_VERSION }}
- name: Check (workspace, tests, benches & all features)
run: cargo check --workspace --tests --benches --all-features

- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: Cache Cargo index
uses: actions/cache@v4
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-index-
- name: Cache Cargo build
uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-build-
- name: Check Formatting
run: cargo fmt --all -- --check

- name: Run Clippy
run: cargo test --features depth_16,depth_20,depth_30
Expand Down

0 comments on commit 6bc6828

Please sign in to comment.