Skip to content

Commit

Permalink
update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
pdtfh committed Sep 16, 2024
1 parent 59b2a0a commit 31e09bd
Showing 1 changed file with 63 additions and 25 deletions.
88 changes: 63 additions & 25 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,41 +13,79 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install Rust
uses: actions-rs/toolchain@v1
uses: actions/checkout@v4

- name: Set up Rust
run: |
rustup update ${{ env.NIGHTLY_VERSION }} && rustup default ${{ env.NIGHTLY_VERSION }}
- name: Cache Cargo registry
uses: actions/cache@v4
with:
profile: minimal
toolchain: ${{ env.NIGHTLY_VERSION }}
override: true
components: rustfmt, clippy
- name: Check Formatting
uses: actions-rs/cargo@v1
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:
command: fmt
args: --all -- --check
- name: Run Clippy
uses: actions-rs/clippy-check@v1
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:
token: ${{ secrets.GITHUB_TOKEN }}
args: --features depth_16,depth_20,depth_30
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 clippy --features depth_16,depth_20,depth_30

test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install Rust
uses: actions-rs/toolchain@v1
uses: actions/checkout@v4

- name: Set up Rust
run: |
rustup update ${{ env.NIGHTLY_VERSION }} && rustup default ${{ env.NIGHTLY_VERSION }}
- name: Cache Cargo registry
uses: actions/cache@v4
with:
profile: minimal
toolchain: ${{ env.RUST_VERSION }}
override: true
- name: Run Tests
uses: actions-rs/cargo@v1
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:
command: test
args: --features depth_16,depth_20,depth_30
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: Run Clippy
run: cargo test --features depth_16,depth_20,depth_30
# vet:
# name: Vet Dependencies
# runs-on: ubuntu-latest
Expand Down

0 comments on commit 31e09bd

Please sign in to comment.