-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (41 loc) · 1.33 KB
/
docker-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Test the stack using docker compose
on:
workflow_call:
env:
COMPOSE_FILE: docker-compose.yml:docker-compose.ci.yml
jobs:
test:
runs-on: ubuntu-latest
permissions:
packages: read
contents: read
steps:
- name: Set the DOCKER_APP_IMAGE environment variable
run: echo "DOCKER_APP_IMAGE=ghcr.io/${GITHUB_REPOSITORY,,}:sha-${GITHUB_SHA:0:7}" >> "$GITHUB_ENV"
- name: Dump the environment
run: env | sort
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Prepare the stack
run: |
mkdir -p tmp/artifacts
docker compose up --build --pull=always --quiet-pull --wait
docker compose exec app setup
- name: Run the test suite
shell: bash
run: |
docker compose exec app test | tee tmp/artifacts/test-results.html
- name: Write service and event logs
if: ${{ always() }}
run: |
docker compose logs > tmp/artifacts/docker-services.log
- name: Archive test results and logs
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: Test Summary
path: tmp/artifacts