@@ -26,26 +26,46 @@ jobs:
2626 strategy :
2727 matrix :
2828 container :
29- - xenial
30- - bionic
31- - focal
32- - docurium
29+ - name : xenial
30+ - name : bionic
31+ - name : focal
32+ - name : docurium
33+ - name : bionic-x86
34+ dockerfile : bionic
35+ base : multiarch/ubuntu-core:x86-bionic
36+ qemu : true
37+ - name : bionic-arm32
38+ dockerfile : bionic
39+ base : multiarch/ubuntu-core:armhf-bionic
40+ qemu : true
41+ - name : bionic-arm64
42+ dockerfile : bionic
43+ base : multiarch/ubuntu-core:arm64-bionic
44+ qemu : true
3345 runs-on : ubuntu-latest
3446 steps :
3547 - name : Check out repository
3648 uses : actions/checkout@v2
3749 with :
3850 fetch-depth : 0
3951 if : github.event_name == 'push'
52+ - name : Setup QEMU
53+ run : docker run --rm --privileged multiarch/qemu-user-static:register --reset
54+ if : matrix.container.qemu == true
4055 - name : Download existing container
41- run : ci/getcontainer.sh ${{ env.docker-config-path }}/${{ matrix.container }}
56+ run : |
57+ "${{ github.workspace }}/ci/getcontainer.sh" "${{ matrix.container.name }}" "${{ matrix.container.dockerfile }}"
4258 env :
4359 DOCKER_REGISTRY : ${{ env.docker-registry }}
4460 GITHUB_TOKEN : ${{ secrets.github_token }}
61+ working-directory : ${{ env.docker-config-path }}
4562 if : github.event_name == 'push'
4663 - name : Build and publish image
4764 run : |
48- docker build -t ${{ env.docker-registry-container-sha }} --build-arg BASE=${{ matrix.container.base }} -f ${{ matrix.container }} .
65+ if [ "${{ matrix.container.base }}" != "" ]; then
66+ BASE_ARG="--build-arg BASE=${{ matrix.container.base }}"
67+ fi
68+ docker build -t ${{ env.docker-registry-container-sha }} ${BASE_ARG} -f ${{ env.dockerfile }} .
4969 docker push ${{ env.docker-registry-container-sha }}
5070 working-directory : ${{ env.docker-config-path }}
5171 if : github.event_name == 'push' && env.docker-container-exists != 'true'
@@ -55,40 +75,45 @@ jobs:
5575 # or on the actual hosts (macOS, Windows).
5676 build :
5777 name : Build
58- needs : [build_containers]
78+ needs : [ build_containers ]
5979 strategy :
6080 matrix :
6181 platform :
6282 - # Xenial, GCC, OpenSSL
63- image : xenial
83+ container :
84+ name : xenial
6485 env :
6586 CC : gcc
6687 CMAKE_GENERATOR : Ninja
6788 CMAKE_OPTIONS : -DUSE_HTTPS=OpenSSL -DREGEX_BACKEND=builtin -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
6889 os : ubuntu-latest
6990 - # Xenial, GCC, mbedTLS
70- image : xenial
91+ container :
92+ name : xenial
7193 env :
7294 CC : gcc
7395 CMAKE_GENERATOR : Ninja
7496 CMAKE_OPTIONS : -DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
7597 os : ubuntu-latest
7698 - # Xenial, Clang, OpenSSL
77- image : xenial
99+ container :
100+ name : xenial
78101 env :
79102 CC : clang
80103 CMAKE_GENERATOR : Ninja
81104 CMAKE_OPTIONS : -DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
82105 os : ubuntu-latest
83106 - # Xenial, Clang, mbedTLS
84- image : xenial
107+ container :
108+ name : xenial
85109 env :
86110 CC : clang
87111 CMAKE_OPTIONS : -DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
88112 CMAKE_GENERATOR : Ninja
89113 os : ubuntu-latest
90114 - # Focal, Clang 10, mbedTLS, MemorySanitizer
91- image : focal
115+ container :
116+ name : focal
92117 env :
93118 CC : clang-10
94119 CFLAGS : -fsanitize=memory -fsanitize-memory-track-origins=2 -fsanitize-blacklist=/home/libgit2/source/script/sanitizers.supp -fno-optimize-sibling-calls -fno-omit-frame-pointer
99124 ASAN_SYMBOLIZER_PATH : /usr/bin/llvm-symbolizer-10
100125 os : ubuntu-latest
101126 - # Focal, Clang 10, OpenSSL, UndefinedBehaviorSanitizer
102- image : focal
127+ container :
128+ name : focal
103129 env :
104130 CC : clang-10
105131 CFLAGS : -fsanitize=undefined,nullability -fno-sanitize-recover=undefined,nullability -fsanitize-blacklist=/home/libgit2/source/script/sanitizers.supp -fno-optimize-sibling-calls -fno-omit-frame-pointer
@@ -110,7 +136,8 @@ jobs:
110136 ASAN_SYMBOLIZER_PATH : /usr/bin/llvm-symbolizer-10
111137 os : ubuntu-latest
112138 - # Focal, Clang 10, OpenSSL, ThreadSanitizer
113- image : focal
139+ container :
140+ name : focal
114141 env :
115142 CC : clang-10
116143 CFLAGS : -fsanitize=thread -fno-optimize-sibling-calls -fno-omit-frame-pointer
@@ -181,21 +208,26 @@ jobs:
181208 run : ci/setup-${{ matrix.platform.setup-script }}.sh
182209 shell : bash
183210 if : matrix.platform.setup-script != ''
211+ - name : Setup QEMU
212+ run : docker run --rm --privileged multiarch/qemu-user-static:register --reset
213+ if : matrix.platform.container.qemu == true
184214 - name : Download container
185- run : ci/getcontainer.sh ${{ env.docker-config-path }}/${{ matrix.platform.image }}
215+ run : |
216+ "${{ github.workspace }}/ci/getcontainer.sh" "${{ matrix.platform.container.name }}" "${{ matrix.platform.container.dockerfile }}"
186217 env :
187218 DOCKER_REGISTRY : ${{ env.docker-registry }}
188219 GITHUB_TOKEN : ${{ secrets.github_token }}
189- if : matrix.platform.image != ''
220+ working-directory : ${{ env.docker-config-path }}
221+ if : matrix.platform.container.name != ''
190222 - name : Create container
191- run : docker build -t ${{ env.docker-registry-container-sha }} -f ${{ matrix.platform.image }} .
223+ run : docker build -t ${{ env.docker-registry-container-sha }} -f ${{ env.dockerfile }} .
192224 working-directory : ${{ env.docker-config-path }}
193- if : matrix.platform.image != '' && env.docker-container-exists != 'true'
225+ if : matrix.platform.container.name != '' && env.docker-container-exists != 'true'
194226 - name : Build and test
195227 run : |
196228 export GITTEST_NEGOTIATE_PASSWORD="${{ secrets.GITTEST_NEGOTIATE_PASSWORD }}"
197229
198- if [ -n "${{ matrix.platform.image }}" ]; then
230+ if [ -n "${{ matrix.platform.container.name }}" ]; then
199231 docker run \
200232 --rm \
201233 -v "$(pwd):/home/libgit2/source" \
@@ -229,6 +261,13 @@ jobs:
229261 needs : [build_containers]
230262 runs-on : ubuntu-latest
231263 steps :
264+ - name : Setup defaults
265+ run : |
266+ if [ "${{ matrix.container.dockerfile }}" = "" ]; then
267+ echo "dockerfile=${{ matrix.container.dockerfile }}" >> $GITHUB_ENV
268+ else
269+ echo "dockerfile=${{ matrix.container.dockerfile }}" >> $GITHUB_ENV
270+ fi
232271 - name : Check out repository
233272 uses : actions/checkout@v2
234273 with :
0 commit comments