Skip to content

Fix e2e test (#89)

Fix e2e test (#89) #6

Workflow file for this run

name: E2E tests
on: # @TODO TBD WHEN WE RUN
push:
branches: [ "main" ]
workflow_dispatch:
inputs:
GIT_REF:
description: 'Commit hash to run the tests'
required: true
jobs:
build-quesma-docker-image:
strategy:
matrix:
module: [ "quesma" ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: ## @TODO REMOVE
ref: ${{ github.event.inputs.GIT_REF }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set up Go
uses: actions/setup-go@v5
with:
cache-dependency-path: ${{ matrix.module }}/go.sum
go-version: '1.22'
- name: Build and export
uses: docker/build-push-action@v5
with:
context: ${{ matrix.module }}/.
tags: ${{ matrix.module }}:latest
outputs: type=docker,dest=/tmp/image.tar
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.module }}
path: /tmp/image.tar
retention-days: 1
e2e-test-run:
runs-on: ubuntu-latest
needs: [build-quesma-docker-image]
steps:
- uses: actions/checkout@v4
with: ## @TODO REMOVE
ref: ${{ github.event.inputs.GIT_REF }}
- name: Set up Go
uses: actions/setup-go@v5
with:
cache-dependency-path: smoke-test/go.sum
go-version: '1.22'
- name: Download images
uses: actions/download-artifact@v4
with:
path: /tmp/images
- name: Load images
run: |
for file in /tmp/images/*/*.tar; do
docker load --input $file
done
docker image ls -a
- name: Build and start docker-compose
timeout-minutes: 10
run: docker-compose -f docker/e2e.yml up -d
- name: Wait until services are healthy
timeout-minutes: 6
working-directory: smoke-test
run: go run . --wait-for-start
- name: Run e2e tests
working-directory: quesma
run: go test --tags=integration -v ./...