clippy #79
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: build | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
- dev | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
rustfmt: | |
name: rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rs/toolchain@v1 | |
with: # use nightly rustfmt rules | |
toolchain: nightly | |
override: true | |
profile: minimal | |
components: rustfmt | |
# from stable toolchain: | |
# cargo +nightly fmt --all | |
- run: cargo fmt --all -- --check | |
test: | |
name: test | |
env: | |
# Emit backtraces on panics. | |
RUST_BACKTRACE: 1 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- run: cargo test --verbose --workspace | |
examples: | |
name: examples | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: install grpcurl | |
run: | | |
sudo curl -sL https://github.com/fullstorydev/grpcurl/releases/download/v1.8.1/grpcurl_1.8.1_linux_x86_64.tar.gz | sudo tar xvz -C /usr/local/bin/ | |
sudo chmod +x /usr/local/bin/grpcurl | |
- name: httpbin post | |
run: cargo run -- record ./test_data post | |
- name: httpbin take | |
run: cargo run -- take ./test_data/post.01s.body.fr.json | |
- name: httpbin vrecord | |
run: cargo run -- vrecord ./test_data/post.vr.json | |
- name: httpbin vrecord alt | |
run: cargo run -- vrecord ./test_data/alt_post.vr.json | |
- name: grpcbin headers | |
run: cargo run -- record ./test_data grpc | |
lint: | |
name: lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
profile: minimal | |
components: clippy | |
- run: cargo clippy --all |