Skip to content

Fix pair_aggregator idempotency check #2411

Fix pair_aggregator idempotency check

Fix pair_aggregator idempotency check #2411

Workflow file for this run

name: Docker
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build_docker:
strategy:
matrix:
rust-features: [["default"], ["integration-testing", "admin"]]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: resolve_variables
run: |
echo "GIT_REVISION=$(git describe --always --dirty=-modified)" >> $GITHUB_OUTPUT
# Join features with , for RUST_FEATURES, but - for cache keys, where commas are illegal
echo "CACHE_KEY=${{ join(matrix.rust-features, '-') }}" >> $GITHUB_OUTPUT
echo "RUST_FEATURES=${{ join(matrix.rust-features, ',') }}" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver: docker-container
use: true
- name: Build
uses: docker/build-push-action@v6
with:
context: .
push: false
load: true
cache-from: |
type=gha,scope=main-${{ steps.resolve_variables.outputs.CACHE_KEY }}
type=gha,scope=${{ github.ref_name }}-${{ steps.resolve_variables.outputs.CACHE_KEY }}
cache-to: type=gha,scope=${{ github.ref_name }}-${{ steps.resolve_variables.outputs.CACHE_KEY }},mode=max
build-args: |
GIT_REVISION=${{ steps.resolve_variables.outputs.GIT_REVISION }}
RUST_FEATURES=${{ steps.resolve_variables.outputs.RUST_FEATURES }}
# Test the dev compose, which should use the images built earlier. Technically this is only
# interesting when feature integration-testing is on, but we may as well exercise both.
#
# Bring the environment up, down and up again to ensure all services can restart
- name: Compose (dev)
id: compose-dev
run: |
docker compose -f compose.dev.yaml up --wait --wait-timeout 120
docker compose down
docker compose -f compose.dev.yaml up --wait --wait-timeout 120
- name: Inspect dev containers
if: ${{ failure() && steps.compose-dev.outcome != 'success' }}
run: |
docker compose ps --all
for NAME in `docker compose ps --all --format json | jq -r '.Name'`; do
echo $NAME
docker inspect $NAME
docker logs $NAME
done
# Test the non-dev compose, which we use for demo purposes. This pulls images from remote repos,
# so no need to build anything.
# Ideally we'd test on macOS and Windows, too, but those runners don't have Docker:
# https://github.com/actions/runner-images/issues/2150
# https://github.com/actions/runner/issues/904
compose:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# This should work without any of the project sources except compose.yaml
with:
sparse-checkout: |
compose.yaml
# Disable cone mode so we only grab a specific file
# https://github.com/actions/checkout?tab=readme-ov-file#fetch-only-a-single-file
# https://git-scm.com/docs/git-sparse-checkout
sparse-checkout-cone-mode: false
- name: Compose
id: compose
run: docker compose up --wait --wait-timeout 120
- name: Inspect containers
if: ${{ failure() && steps.compose.outcome != 'success' }}
run: |
docker compose ps --all
for NAME in `docker compose ps --all --format json | jq -r '.Name'`; do
echo $NAME
docker inspect $NAME
docker logs $NAME
done