name: Build code0-flow crate
on:
push:
pull_request:
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
jobs:
ci:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v7
- name: Setup rust
run: |
rustup update --no-self-update stable
rustup component add rustfmt clippy
- name: Install protoc
run: |
sudo apt-get update
sudo apt-get install -y protobuf-compiler
protoc --version
- name: Check formatting
run: cargo fmt --all -- --check
- name: Check default feature set
run: cargo check --locked --all-targets
- name: Check feature combinations
run: |
cargo check --locked --all-targets --no-default-features
cargo check --locked --all-targets --features flow_definition
cargo check --locked --all-targets --features flow_config
cargo check --locked --all-targets --features flow_health
cargo check --locked --all-targets --features flow_service
cargo check --locked --all-targets --features flow_telemetry
cargo check --locked --all-targets --features all
- name: Run clippy
run: cargo clippy --locked --all-targets --features all -- -D warnings
- name: Run tests
run: cargo test --locked --features all
- name: Package crate
run: cargo package --locked