Skip to content

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

refactor(test): consolidate testing infrastructure with Docker Compose

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

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
types:
- opened
- reopened
- synchronize
permissions:
contents: read
pull-requests: read
jobs:
# ---------------------------------------------------------------------------
# BUILD AND UNIT TESTS (special case - Gazelle + build + unit tests)
# ---------------------------------------------------------------------------
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"
# ---------------------------------------------------------------------------
# INTEGRATION TESTS (e2e, gateway, orchestrator)
# ---------------------------------------------------------------------------
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 on path changes)
# ---------------------------------------------------------------------------
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 Test
needs: detect-changes
if: needs.detect-changes.outputs.counter == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- uses: ./.github/actions/run-bazel-test
with:
target: //test/integration/extension/counter/...
queue-integration-test:
name: Queue Extension Test
needs: detect-changes
if: needs.detect-changes.outputs.queue == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- uses: ./.github/actions/run-bazel-test
with:
target: //test/integration/extension/queue/...
storage-integration-test:
name: Storage Extension Test
needs: detect-changes
if: needs.detect-changes.outputs.storage == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- uses: ./.github/actions/run-bazel-test
with:
target: //test/integration/extension/storage/...
# ---------------------------------------------------------------------------
# REQUIRED CHECKS GATE
# ---------------------------------------------------------------------------
required-checks:
name: Required Checks
runs-on: ubuntu-latest
needs:
- build-and-unit-test
- e2e-integration-test
- gateway-integration-test
- orchestrator-integration-test
- counter-integration-test
- queue-integration-test
- storage-integration-test
steps:
- name: All required checks passed
run: |
echo "✅ All required checks passed!"
echo ""
echo "Core checks:"
echo " - build-and-unit-test"
echo " - e2e-integration-test"
echo " - gateway-integration-test"
echo " - orchestrator-integration-test"
echo ""
echo "Extension checks (if paths changed):"
echo " - counter-integration-test"
echo " - queue-integration-test"
echo " - storage-integration-test"
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "📝 To add a new required check:"
echo " 1. Add the job to this workflow"
echo " 2. Add the job name to the 'needs:' list above"
echo " 3. That's it! No branch protection updates needed."
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"