Test build image #113
This file contains 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: E2E Tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
permissions: | |
contents: read | |
packages: write | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
e2e-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
name: Check out repository code | |
- name: Log in to Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
tags: | | |
type=ref,event=branch | |
type=ref,event=tag | |
type=sha | |
type=raw,value=latest | |
# Setup Docker Buildx | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: Dockerfile | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
platforms: linux/amd64 | |
annotations: ${{ steps.meta.outputs.annotations }} | |
cache-from: type=gha,scope=${{ github.workflow }} | |
cache-to: type=gha,mode=max,scope=${{ github.workflow }} | |
# Starting background services | |
- name: Start background services | |
run: docker compose up -d --build localstack coordinator participant_0 participant_1 coordinator_db participant_0_db participant_1_db | |
# Running e2e tests | |
- name: Run e2e tests | |
run: docker compose up --build --abort-on-container-exit --exit-code-from e2e_test e2e_test | |
# Ensure the action fails if the e2e_test service fails | |
continue-on-error: false | |
# Cleanup | |
- name: Cleanup | |
if: always() | |
run: docker compose down --volumes --remove-orphans |