-
Notifications
You must be signed in to change notification settings - Fork 0
127 lines (108 loc) · 3.27 KB
/
Copy pathtest.yaml
File metadata and controls
127 lines (108 loc) · 3.27 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: Test
on:
push:
branches:
- main
tags:
- '*'
pull_request:
branches:
- '*'
workflow_dispatch:
inputs:
logLevel:
description: Log Level
default: info
type: choice
options:
- debug
- error
- fatal
- info
- panic
- warning
environment:
description: Environment
default: test
jobs:
test-amd64:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- platform: linux/amd64
dockerfile: Dockerfile.amd64
tag: tinyclib:amd64
test: amd64
steps:
- name: Docker Setup QEMU
if: matrix.platform != 'linux/amd64'
uses: docker/setup-qemu-action@v3.6.0 # v3.6.0 - latest as of 2025-04-27
with:
platforms: all
- name: Docker Setup Buildx
uses: docker/setup-buildx-action@v3.10.0 # v3.10.0 - latest as of 2025-04-27
- name: Checkout code
uses: actions/checkout@v4 # v4.2.2 - latest as of 2025-04-27
- name: Create Buildx
run: |
docker buildx create --name tests --use
docker buildx inspect --bootstrap
- name: Build images
run: |
docker images
docker buildx ls --no-trunc
docker buildx build --platform ${{ matrix.platform }} -f scripts/tests/docker/${{ matrix.dockerfile }} -t ${{ matrix.tag }} . --load
docker images
- name: Test
run: |
for platform in ${{ matrix.platform }}; do
for tag in ${{ matrix.tag }}; do
echo "Running container for platform: $platform, tag: $tag"
docker run --platform $platform $tag
done
done
test-arm64:
runs-on: ubuntu-24.04-arm
strategy:
matrix:
include:
- platform: linux/arm64
dockerfile: Dockerfile.arm64
tag: tinyclib:arm64
test: arm64
- platform: linux/arm/v6
dockerfile: Dockerfile.armv6
tag: tinyclib:armv6
test: armv6
- platform: linux/arm/v7
dockerfile: Dockerfile.armv7
tag: tinyclib:armv7
test: armv7
- platform: linux/arm64/v8
dockerfile: Dockerfile.armv8
tag: tinyclib:armv8
test: armv8
steps:
- name: Docker Setup Buildx
uses: docker/setup-buildx-action@v3.10.0 # v3.10.0 - latest as of 2025-04-27
- name: Checkout code
uses: actions/checkout@v4 # v4.2.2 - latest as of 2025-04-27
- name: Create Buildx
run: |
docker buildx create --name tests --use
docker buildx inspect --bootstrap
- name: Build images
run: |
docker images
docker buildx ls --no-trunc
docker buildx build --platform ${{ matrix.platform }} -f scripts/tests/docker/${{ matrix.dockerfile }} -t ${{ matrix.tag }} . --load
docker images
- name: Test
run: |
for platform in ${{ matrix.platform }}; do
for tag in ${{ matrix.tag }}; do
echo "Running container for platform: $platform, tag: $tag"
docker run --platform $platform $tag
done
done