Skip to content

Merge pull request #52 from Eeshu-Yadav/chore/remove-redundant-spdx-h… #7

Merge pull request #52 from Eeshu-Yadav/chore/remove-redundant-spdx-h…

Merge pull request #52 from Eeshu-Yadav/chore/remove-redundant-spdx-h… #7

Workflow file for this run

name: CI — fmt, clippy, build, test
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
env:
CARGO_CACHE_PATH: ~/.cargo/registry
CARGO_GIT_PATH: ~/.cargo/git
TARGET_DIR: target
jobs:
# Fast checks that run in parallel (no build artifacts needed)
checks:
name: fmt + clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Initialize git submodules
run: git submodule update --init --recursive
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
${{ env.CARGO_CACHE_PATH }}
${{ env.CARGO_GIT_PATH }}
key: ${{ runner.os }}-cargo-checks-${{ hashFiles('**/Cargo.lock', 'envoy-data-plane-api/build.rs') }}
- name: Install protoc
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy
profile: minimal
- name: Check formatting
run: cargo fmt --all -- --check
- name: Run clippy (fail on warnings)
run: cargo clippy --all-targets --all-features
# Build and test that share artifacts
build-and-test:
name: build + test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Initialize git submodules
run: git submodule update --init --recursive
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
${{ env.CARGO_CACHE_PATH }}
${{ env.CARGO_GIT_PATH }}
${{ env.TARGET_DIR }}
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock', 'envoy-data-plane-api/build.rs') }}
- name: Install protoc
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- name: Build (release)
run: cargo build --workspace --release --locked
- name: Run tests
run: cargo test --workspace --release --locked