Skip to content

Commit

Permalink
workflow: add cache
Browse files Browse the repository at this point in the history
  • Loading branch information
KevFan committed Oct 12, 2023
1 parent 38f55ca commit f228dfe
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 62 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: abelfodil/protoc-action@v1
with:
protoc-version: '3.19.4'
Expand All @@ -42,11 +38,9 @@ jobs:
redis-version: 5
# Nightly is required for code coverage with doctests
# https://github.com/taiki-e/cargo-llvm-cov/issues/2
- uses: actions-rs/toolchain@v1
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- uses: abelfodil/protoc-action@v1
with:
protoc-version: '3.19.4'
Expand Down
68 changes: 14 additions & 54 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: abelfodil/protoc-action@v1
with:
protoc-version: '3.19.4'
- uses: actions-rs/cargo@v1
with:
command: check
- run: cargo check

test:
name: Test Suite
Expand All @@ -45,55 +39,33 @@ jobs:
- uses: supercharge/[email protected]
with:
redis-version: 5
# Nightly is required for code coverage with doctests
# https://github.com/taiki-e/cargo-llvm-cov/issues/2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: abelfodil/protoc-action@v1
with:
protoc-version: '3.19.4'
- uses: actions-rs/cargo@v1
with:
command: test
args: --all-features -vv
- run: cargo test --all-features -vv

fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- run: cargo fmt --all -- --check

clippy:
needs: check
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: rustup component add clippy
- uses: abelfodil/protoc-action@v1
with:
protoc-version: '3.19.4'
- uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-features --all-targets -- -D warnings
- run: cargo clippy --all-features --all-targets -- -D warnings

bench:
name: Bench
Expand All @@ -103,32 +75,20 @@ jobs:
- uses: supercharge/[email protected]
with:
redis-version: 5
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: abelfodil/protoc-action@v1
with:
protoc-version: '3.19.4'
- uses: actions-rs/cargo@v1
with:
command: bench
- run: cargo bench

wasm-build:
name: Build for WASM
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-unknown
override: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --target=wasm32-unknown-unknown --no-default-features --lib --manifest-path ./limitador/Cargo.toml
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: rustup target add wasm32-unknown-unknown
- run: cargo build --target=wasm32-unknown-unknown --no-default-features --lib --manifest-path ./limitador/Cargo.toml

kind:
name: Try in kind (Kubernetes in Docker)
Expand Down

0 comments on commit f228dfe

Please sign in to comment.