Skip to content

Update CI setup

Update CI setup #81

Workflow file for this run

name: build
on:
pull_request:
push:
branches:
- master
- dev
env:
CARGO_TERM_COLOR: always
GRPCURLV: "1.8.1"
jobs:
lint:
name: rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: rustfmt
# from stable toolchain:
# cargo +nightly fmt --all
- run: cargo fmt --all -- --check
- run: cargo clippy --all
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@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: install grpcurl
env:
GRPCURL_URL: "https://github.com/fullstorydev/grpcurl/releases/download/\
v${GRPCURLV}/grpcurl_${GRPCURLV}_linux_x86_64.tar.gz"
run: |
sudo curl -sL "$GRPCURL_URL" sudo tar xvz -C /usr/local/bin/
- 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