membership proof #247
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: Rust CI | |
on: | |
push: | |
branches: | |
- '**' | |
pull_request: | |
branches: | |
- '**' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
rust: | |
- version: stable | |
profile: minimal | |
- version: beta | |
profile: default | |
- version: nightly | |
profile: default | |
services: | |
redis: | |
image: redis | |
ports: | |
- 6379:6379 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Rust | |
run: | | |
rustup toolchain install ${{ matrix.rust.version }} --profile ${{ matrix.rust.profile }} | |
rustup default ${{ matrix.rust.version }} | |
- name: Install protoc | |
run: sudo apt-get install protobuf-compiler | |
- name: Cache cargo build | |
uses: Swatinem/rust-cache@v2 | |
with: | |
key: ${{ runner.os }}-cargo-${{ matrix.rust.version }}-${{ hashFiles('**/Cargo.lock') }} | |
- name: Install dependencies | |
run: cargo fetch | |
- name: Wait for Redis to start | |
run: | | |
while ! nc -z localhost 6379; do | |
echo "Waiting for Redis..." | |
sleep 1 | |
done | |
shell: bash | |
# can execute code formatting, to be enabled later | |
# there are some oddities with it being configured to ONLY | |
# run on nightly AND it fails, i can work through and fix if | |
# you want to enable it | |
# | |
# - name: Check code formatting | |
# # run only on nightly because of import_granularity=Crate | |
# if: matrix.rust.version == 'nightly' | |
# run: cargo fmt --all -- --check | |
- name: Add clippy component if not stable | |
if: matrix.rust.version != 'stable' | |
run: rustup component add clippy | |
- name: Run clippy | |
run: cargo clippy --all-targets --all-features -- -D warnings | |
- name: Build project | |
run: cargo build --verbose | |
- name: Run tests | |
run: cargo test --verbose | |
- name: Install cargo-audit | |
run: cargo install cargo-audit | |
- name: Run cargo audit | |
run: cargo audit |