Skip to content

feat(ci): unified image repo with shared builder and tag-based variants #1536

feat(ci): unified image repo with shared builder and tag-based variants

feat(ci): unified image repo with shared builder and tag-based variants #1536

Workflow file for this run

name: CI
on:
pull_request:
paths:
- "src/**"
- "crates/**"
- "operator/**"
- "Cargo.toml"
- "Cargo.lock"
- "Dockerfile*"
env:
CARGO_TERM_COLOR: always
jobs:
changes:
runs-on: ubuntu-latest
outputs:
core: ${{ steps.filter.outputs.core }}
operator: ${{ steps.filter.outputs.operator }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- id: filter
run: |
BASE=${{ github.event.pull_request.base.sha }}
HEAD=${{ github.event.pull_request.head.sha }}
CHANGED=$(git diff --name-only "$BASE" "$HEAD")
echo "core=$(echo "$CHANGED" | grep -qE '^(src/|crates/|Cargo\.(toml|lock))' && echo true || echo false)" >> "$GITHUB_OUTPUT"
echo "operator=$(echo "$CHANGED" | grep -q '^operator/' && echo true || echo false)" >> "$GITHUB_OUTPUT"
check:
needs: changes
if: needs.changes.outputs.core == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- name: cargo check
run: cargo check --workspace
- name: cargo clippy
run: cargo clippy --workspace -- -D warnings
- name: cargo clippy (unified)
run: cargo clippy --workspace --features unified -- -D warnings
- name: cargo test
run: cargo test --workspace
# gateway tests are now covered by `cargo test --workspace` in the check job above
# (openab-gateway is a workspace member in crates/openab-gateway/)
operator:
needs: changes
if: needs.changes.outputs.operator == 'true'
runs-on: ubuntu-latest
defaults:
run:
working-directory: operator
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
with:
workspaces: operator
- name: cargo check
run: cargo check
- name: cargo clippy
run: cargo clippy -- -D warnings
- name: cargo test
run: cargo test
- name: cargo build
run: cargo build --release