Skip to content

refactor(test): consolidate testing infrastructure with Docker Compose #2

refactor(test): consolidate testing infrastructure with Docker Compose

refactor(test): consolidate testing infrastructure with Docker Compose #2

Workflow file for this run

name: CI
# This is the ONLY required status check in branch protection
# All jobs below must pass for this workflow to succeed
# The "required-checks-pass" gate job ensures core checks complete
on:
push:
branches:
- main
pull_request:
types:
- opened
- reopened
- synchronize
permissions:
contents: read
pull-requests: read
jobs:
# ============================================================================
# CORE CHECKS (Always Run)
# ============================================================================
build-and-unit-test:
name: Build and Unit Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Check BUILD files are up to date
run: |
echo "Running Gazelle to check BUILD files..."
make gazelle
if ! git diff --quiet; then
echo "❌ BUILD files are out of date!"
echo ""
echo "The following files were modified by Gazelle:"
git diff --name-only
echo ""
echo "Please run 'make gazelle' locally and commit the changes."
exit 1
fi
echo "✅ BUILD files are up to date"
- name: Build project
run: make build
- name: Run unit tests
run: make test || echo "No unit tests found"
e2e-integration-test:
name: E2E Integration Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Run E2E tests
run: make e2e-test
- uses: ./.github/actions/logs
gateway-integration-test:
name: Gateway Integration Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Run Gateway integration tests
run: make integration-test-gateway
- uses: ./.github/actions/logs
orchestrator-integration-test:
name: Orchestrator Integration Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Run Orchestrator integration tests
run: make integration-test-orchestrator
- uses: ./.github/actions/logs
# ============================================================================
# EXTENSION TESTS (Conditional - Only Run When Paths Change)
# ============================================================================
detect-changes:
name: Detect Extension Changes
runs-on: ubuntu-latest
outputs:
counter: ${{ steps.filter.outputs.counter }}
queue: ${{ steps.filter.outputs.queue }}
storage: ${{ steps.filter.outputs.storage }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
counter:
- 'extension/counter/**'
- 'test/integration/extension/counter/**'
- 'entity/**'
- '.github/workflows/ci.yml'
queue:
- 'extension/queue/**'
- 'test/integration/extension/queue/**'
- 'entity/**'
- '.github/workflows/ci.yml'
storage:
- 'extension/storage/**'
- 'test/integration/extension/storage/**'
- 'entity/**'
- '.github/workflows/ci.yml'
counter-integration-test:
name: Counter Extension Integration Test
needs: detect-changes
if: needs.detect-changes.outputs.counter == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Run counter extension tests
run: ./tool/bazel test //test/integration/extension/counter/... --test_output=errors
- uses: ./.github/actions/logs
queue-integration-test:
name: Queue Extension Integration Test
needs: detect-changes
if: needs.detect-changes.outputs.queue == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Run queue extension tests
run: ./tool/bazel test //test/integration/extension/queue/... --test_output=errors
- uses: ./.github/actions/logs
storage-integration-test:
name: Storage Extension Integration Test
needs: detect-changes
if: needs.detect-changes.outputs.storage == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Run storage extension tests
run: ./tool/bazel test //test/integration/extension/storage/... --test_output=errors
- uses: ./.github/actions/logs
# ============================================================================
# GATE JOB - Require ONLY This Check in Branch Protection
# ============================================================================
required-checks:
name: Required Checks
runs-on: ubuntu-latest
# Only depend on always-run jobs
# Extension tests are optional and may be skipped
needs:
- build-and-unit-test
- e2e-integration-test
- gateway-integration-test
- orchestrator-integration-test
steps:
- name: All required checks passed
run: |
echo "✅ All required checks passed!"
echo ""
echo "The following checks completed successfully:"
echo " - build-and-unit-test"
echo " - e2e-integration-test"
echo " - gateway-integration-test"
echo " - orchestrator-integration-test"
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "📝 To add a new required check:"
echo " 1. Add the job to this workflow file"
echo " 2. Add the job name to the 'needs:' list above"
echo " 3. That's it! No branch protection updates needed."
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"