CI/CD Pipeline #109
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI/CD Pipeline | |
| on: | |
| push: | |
| branches: [ main, dev ] | |
| pull_request: | |
| branches: [ main, dev ] | |
| schedule: | |
| # Run e2e tests daily at 2 AM UTC | |
| - cron: '0 2 * * *' | |
| permissions: | |
| contents: read | |
| packages: write | |
| statuses: write | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_PREFIX: ${{ github.repository_owner }} | |
| jobs: | |
| check-health: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| compose-file: | |
| - ./compose/compose.prod-local.yaml | |
| - ./compose/compose.dev.yaml | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Clean environment | |
| run: sh scripts/down_all_v.sh | |
| - name: Build and test health | |
| env: | |
| COMPOSE: docker compose -f ${{ matrix.compose-file }} -f ./compose/config/ci-overrides.yaml | |
| run: | | |
| # Try to build the images | |
| $COMPOSE build --pull | |
| # Wait for health checks to pass | |
| $COMPOSE up --wait | |
| - name: Cleanup | |
| if: always() | |
| run: sh scripts/down_all_v.sh | |
| check-health-dev: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Clean environment | |
| run: sh scripts/down_all_v.sh | |
| - name: Build and test health (dev) | |
| env: | |
| COMPOSE: docker compose -f ./compose/compose.dev.yaml -f ./compose/config/ci-overrides.yaml | |
| run: | | |
| $COMPOSE build --pull | |
| $COMPOSE up --wait | |
| - name: Cleanup | |
| if: always() | |
| run: ./scripts/down_all_v.sh | |
| # e2e-tests: | |
| # runs-on: ubuntu-latest | |
| # if: github.event_name == 'schedule' || github.ref == 'refs/heads/main' | |
| # env: | |
| # IMAGE_GROUP: ghcr.io/${{ github.repository_owner }}/random_iceberg | |
| # IMAGE_TAG: 'latest' | |
| # steps: | |
| # - name: Checkout code | |
| # uses: actions/checkout@v4 | |
| # with: | |
| # submodules: recursive | |
| # token: ${{ secrets.GITHUB_TOKEN }} | |
| # - name: Log in to GitHub Container Registry | |
| # uses: docker/login-action@v3 | |
| # with: | |
| # registry: ghcr.io | |
| # username: ${{ github.actor }} | |
| # password: ${{ secrets.GITHUB_TOKEN }} | |
| # - name: Set up Docker Buildx | |
| # uses: docker/setup-buildx-action@v3 | |
| # - name: Clean environment | |
| # run: sh scripts/down_all_v.sh | |
| # - name: Run E2E tests | |
| # env: | |
| # COMPOSE: docker compose -f ./compose/compose.prod-registry.yaml -f ./compose/config/ci-overrides.yaml | |
| # run: | | |
| # $COMPOSE pull | |
| # $COMPOSE up --wait | |
| # - name: Cleanup | |
| # if: always() | |
| # run: sh scripts/down_all_v.sh |