Skip to content

Commit aa42c4c

Browse files
committed
feat: added multi-arch tests
1 parent 22d36d3 commit aa42c4c

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

.github/workflows/test.yaml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ on:
1111
jobs:
1212
test:
1313
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
os: [ubuntu-latest] # Optionally add more OS types if needed
18+
arch: [amd64, arm64, arm/v7, arm/v6, ppc64le, s390x]
19+
1420
outputs:
1521
test_status: ${{ steps.test-result.outcome }}
1622

@@ -20,28 +26,32 @@ jobs:
2026

2127
- name: Set up QEMU
2228
uses: docker/setup-qemu-action@v2
29+
with:
30+
platforms: all
2331

2432
- name: Set up Docker Buildx
2533
uses: docker/setup-buildx-action@v2
34+
with:
35+
driver: docker-container
2636

2737
# Cache Alpine Base Images
2838
- name: Cache Docker Base Images
2939
id: cache-docker-images
3040
uses: actions/cache@v3
3141
with:
3242
path: /tmp/.buildx-cache
33-
key: docker-base-images-${{ runner.os }}-${{ hashFiles('Dockerfile') }}
43+
key: docker-base-images-${{ matrix.arch }}-${{ runner.os }}-${{ hashFiles('Dockerfile') }}
3444
restore-keys: |
35-
docker-base-images-${{ runner.os }}-
45+
docker-base-images-${{ matrix.arch }}-${{ runner.os }}-
3646
3747
# Pre-fetch Alpine Base Images
3848
- name: Preload Base Images
3949
if: steps.cache-docker-images.outputs.cache-hit != 'true'
4050
run: |
41-
docker pull alpine:3.19
42-
docker pull alpine:3.20
43-
docker pull alpine:3.21
44-
docker pull alpine:latest
51+
docker pull --platform linux/${{ matrix.arch }} alpine:3.19
52+
docker pull --platform linux/${{ matrix.arch }} alpine:3.20
53+
docker pull --platform linux/${{ matrix.arch }} alpine:3.21
54+
docker pull --platform linux/${{ matrix.arch }} alpine:latest
4555
4656
- name: Install Docker Compose
4757
uses: docker/setup-buildx-action@v2
@@ -79,4 +89,5 @@ jobs:
7989
env:
8090
LOG_LEVEL: ${{ vars.LOG_LEVEL }}
8191
run: |
92+
echo "Running tests on architecture: ${{ matrix.arch }}"
8293
LOG_LEVEL=DEBUG bash tests/run-tests.sh

0 commit comments

Comments
 (0)