Skip to content

Commit

Permalink
Upgrade GitHub Action Workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
lambdalisue committed May 31, 2023
1 parent bfddac4 commit 24076e4
Show file tree
Hide file tree
Showing 3 changed files with 122 additions and 40 deletions.
26 changes: 23 additions & 3 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,27 @@ jobs:
security_audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/audit-check@v1
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Update local toolchain
run: |
rustup update
cargo install --force cargo-audit
- name: Toolchain info
run: |
rustc --version
cargo --version --verbose
cargo audit --version
- name: Install cargo-audit
run: |
- name: Audit check
run: |
cargo audit
31 changes: 23 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,28 @@ on: [push]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
runner: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
toolchain: stable
- uses: actions-rs/cargo@v1
with:
command: build
args: --release --all-features
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Update local toolchain
run: |
rustup update
- name: Toolchain info
run: |
rustc --version
cargo --version --verbose
- name: Test
run: |
cargo build --release --all-features
105 changes: 76 additions & 29 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,92 @@ name: Test
on: [push]

jobs:
check:
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
toolchain: nightly
components: clippy
override: true
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Update local toolchain
run: |
rustup update
rustup component add rustfmt
- name: Toolchain info
run: |
rustc --version
cargo --version --verbose
cargo fmt --version
- name: Format
run: |
cargo fmt && git diff --exit-code
fmt:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
toolchain: nightly
components: rustfmt
override: true
- uses: actions-rs/cargo@v1
with:
command: fmt
- name: Diff check
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Update local toolchain
run: |
rustup update
rustup component add clippy
- name: Toolchain info
run: |
git diff --exit-code
rustc --version
cargo --version --verbose
cargo clippy --version
- name: Clippy check
run: |
cargo clippy --all-features --all-targets
test:
runs-on: ubuntu-latest
strategy:
matrix:
runner: [ubuntu-latest, macos-latest, windows-latest]
env:
RUNNER: ${{ matrix.runner }}
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
toolchain: nightly
override: true
- uses: actions-rs/cargo@v1
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Update local toolchain
run: |
rustup update
rustup component add llvm-tools-preview
cargo install cargo-llvm-cov
- name: Toolchain info
run: |
rustc --version
cargo --version --verbose
cargo llvm-cov --version
- name: Test
run: |
cargo llvm-cov --all-features --lcov --output-path lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
command: test
args: --all-features
files: lcov.info
env_vars: RUNNER
fail_ci_if_error: true

0 comments on commit 24076e4

Please sign in to comment.