Skip to content

Commit 6a1c887

Browse files
authored
Merge pull request libgit2#5706 from libgit2/ethomson/ci
ci: more GitHub Actions
2 parents 9aa22de + b6a39e3 commit 6a1c887

File tree

13 files changed

+165
-515
lines changed

13 files changed

+165
-515
lines changed

.github/workflows/coverity.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
with:
2121
fetch-depth: 0
2222
- name: Download container
23-
run: ci/getcontainer.sh ci/docker/xenial
23+
run: ci/getcontainer.sh xenial
2424
env:
2525
DOCKER_REGISTRY: ${{ env.docker-registry }}
2626
GITHUB_TOKEN: ${{ secrets.github_token }}

.github/workflows/main.yml

Lines changed: 58 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -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
@@ -99,7 +124,8 @@ jobs:
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:

.github/workflows/nightly.yml

Lines changed: 86 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,41 +11,49 @@ env:
1111
docker-config-path: ci/docker
1212

1313
jobs:
14+
# Run our nightly builds. We build a matrix with the various build
15+
# targets and their details. Then we build either in a docker container
16+
# (Linux) or on the actual hosts (macOS, Windows).
1417
build:
1518
name: Build
1619
strategy:
1720
matrix:
1821
platform:
1922
- # Xenial, GCC, OpenSSL
20-
image: xenial
23+
container:
24+
name: xenial
2125
env:
2226
CC: gcc
2327
CMAKE_GENERATOR: Ninja
2428
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DREGEX_BACKEND=builtin -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
2529
os: ubuntu-latest
2630
- # Xenial, GCC, mbedTLS
27-
image: xenial
31+
container:
32+
name: xenial
2833
env:
2934
CC: gcc
3035
CMAKE_GENERATOR: Ninja
3136
CMAKE_OPTIONS: -DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
3237
os: ubuntu-latest
3338
- # Xenial, Clang, OpenSSL
34-
image: xenial
39+
container:
40+
name: xenial
3541
env:
3642
CC: clang
3743
CMAKE_GENERATOR: Ninja
3844
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
3945
os: ubuntu-latest
4046
- # Xenial, Clang, mbedTLS
41-
image: xenial
47+
container:
48+
name: xenial
4249
env:
4350
CC: clang
4451
CMAKE_OPTIONS: -DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
4552
CMAKE_GENERATOR: Ninja
4653
os: ubuntu-latest
4754
- # Focal, Clang 10, mbedTLS, MemorySanitizer
48-
image: focal
55+
container:
56+
name: focal
4957
env:
5058
CC: clang-10
5159
CFLAGS: -fsanitize=memory -fsanitize-memory-track-origins=2 -fsanitize-blacklist=/home/libgit2/source/script/sanitizers.supp -fno-optimize-sibling-calls -fno-omit-frame-pointer
@@ -56,7 +64,8 @@ jobs:
5664
ASAN_SYMBOLIZER_PATH: /usr/bin/llvm-symbolizer-10
5765
os: ubuntu-latest
5866
- # Focal, Clang 10, OpenSSL, UndefinedBehaviorSanitizer
59-
image: focal
67+
container:
68+
name: focal
6069
env:
6170
CC: clang-10
6271
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
@@ -66,11 +75,19 @@ jobs:
6675
SKIP_NEGOTIATE_TESTS: true
6776
ASAN_SYMBOLIZER_PATH: /usr/bin/llvm-symbolizer-10
6877
os: ubuntu-latest
69-
- # linux arm64
70-
os: [ focal, arm64, self-hosted ]
78+
- # Focal, Clang 10, OpenSSL, ThreadSanitizer
79+
container:
80+
name: focal
7181
env:
72-
CC: gcc
73-
CMAKE_OPTIONS: -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
82+
CC: clang-10
83+
CFLAGS: -fsanitize=thread -fno-optimize-sibling-calls -fno-omit-frame-pointer
84+
CMAKE_OPTIONS: -DCMAKE_PREFIX_PATH=/usr/local -DUSE_HTTPS=OpenSSL -DUSE_SHA1=HTTPS -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON -DUSE_BUNDLED_ZLIB=ON
85+
CMAKE_GENERATOR: Ninja
86+
SKIP_SSH_TESTS: true
87+
SKIP_NEGOTIATE_TESTS: true
88+
ASAN_SYMBOLIZER_PATH: /usr/bin/llvm-symbolizer-10
89+
TSAN_OPTIONS: suppressions=/home/libgit2/source/script/thread-sanitizer.supp second_deadlock_stack=1
90+
os: ubuntu-latest
7491
- # macOS
7592
os: macos-10.15
7693
env:
@@ -86,15 +103,15 @@ jobs:
86103
env:
87104
ARCH: amd64
88105
CMAKE_GENERATOR: Visual Studio 16 2019
89-
CMAKE_OPTIONS: -A x64 -DMSVC_CRTDBG=ON -DDEPRECATE_HARD=ON
106+
CMAKE_OPTIONS: -A x64 -DWIN32_LEAKCHECK=ON -DDEPRECATE_HARD=ON
90107
SKIP_SSH_TESTS: true
91108
SKIP_NEGOTIATE_TESTS: true
92109
- # Windows x86 Visual Studio
93110
os: windows-2019
94111
env:
95112
ARCH: x86
96113
CMAKE_GENERATOR: Visual Studio 16 2019
97-
CMAKE_OPTIONS: -A Win32 -DMSVC_CRTDBG=ON -DDEPRECATE_HARD=ON -DUSE_SHA1=HTTPS -DUSE_BUNDLED_ZLIB=ON
114+
CMAKE_OPTIONS: -A Win32 -DWIN32_LEAKCHECK=ON -DDEPRECATE_HARD=ON -DUSE_SHA1=HTTPS -DUSE_BUNDLED_ZLIB=ON
98115
SKIP_SSH_TESTS: true
99116
SKIP_NEGOTIATE_TESTS: true
100117
- # Windows amd64 mingw
@@ -119,9 +136,53 @@ jobs:
119136
BUILD_PATH: D:\Temp\mingw32\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files (x86)\CMake\bin
120137
SKIP_SSH_TESTS: true
121138
SKIP_NEGOTIATE_TESTS: true
139+
- # Bionic, x86, Clang, OpenSSL
140+
container:
141+
name: bionic-x86
142+
dockerfile: bionic
143+
qemu: true
144+
env:
145+
CC: clang
146+
CMAKE_GENERATOR: Ninja
147+
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
148+
RUN_INVASIVE_TESTS: true
149+
os: ubuntu-latest
150+
- # Bionic, x86, GCC, OpenSSL
151+
container:
152+
name: bionic-x86
153+
dockerfile: bionic
154+
env:
155+
CC: gcc
156+
CMAKE_GENERATOR: Ninja
157+
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
158+
RUN_INVASIVE_TESTS: true
159+
os: ubuntu-latest
160+
- # Bionic, arm32, GCC, OpenSSL
161+
container:
162+
name: bionic-arm32
163+
dockerfile: bionic
164+
qemu: true
165+
env:
166+
CC: gcc
167+
CMAKE_GENERATOR: Ninja
168+
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON -DUSE_GSSAPI=ON
169+
RUN_INVASIVE_TESTS: true
170+
SKIP_PROXY_TESTS: true
171+
os: ubuntu-latest
172+
- # Bionic, arm64, GCC, OpenSSL
173+
container:
174+
name: bionic-arm64
175+
dockerfile: bionic
176+
qemu: true
177+
env:
178+
CC: gcc
179+
CMAKE_GENERATOR: Ninja
180+
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON -DUSE_GSSAPI=ON
181+
RUN_INVASIVE_TESTS: true
182+
SKIP_PROXY_TESTS: true
183+
os: ubuntu-latest
122184
fail-fast: false
123-
env:
124-
ACTIONS_RUNNER_TOKEN: ${{ secrets.ACTIONS_RUNNER_TOKEN }}
185+
env: ${{ matrix.platform.env }}
125186
runs-on: ${{ matrix.platform.os }}
126187
steps:
127188
- name: Check out repository
@@ -131,23 +192,27 @@ jobs:
131192
- name: Set up build environment
132193
run: ci/setup-${{ matrix.platform.setup-script }}.sh
133194
shell: bash
134-
env: ${{ matrix.platform.env }}
135195
if: matrix.platform.setup-script != ''
196+
- name: Setup QEMU
197+
run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
198+
if: matrix.platform.container.qemu == true
136199
- name: Download container
137-
run: ci/getcontainer.sh ${{ env.docker-config-path }}/${{ matrix.platform.image }}
200+
run: |
201+
"${{ github.workspace }}/ci/getcontainer.sh" "${{ matrix.platform.container.name }}" "${{ matrix.platform.container.dockerfile }}"
138202
env:
139203
DOCKER_REGISTRY: ${{ env.docker-registry }}
140204
GITHUB_TOKEN: ${{ secrets.github_token }}
141-
if: matrix.platform.image != ''
205+
working-directory: ${{ env.docker-config-path }}
206+
if: matrix.platform.container.name != ''
142207
- name: Create container
143-
run: docker build -t ${{ env.docker-registry-container-sha }} -f ${{ matrix.platform.image }} .
208+
run: docker build -t ${{ env.docker-registry-container-sha }} -f ${{ env.dockerfile }} .
144209
working-directory: ${{ env.docker-config-path }}
145-
if: matrix.platform.image != '' && env.docker-container-exists != 'true'
210+
if: matrix.platform.container.name != '' && env.docker-container-exists != 'true'
146211
- name: Build and test
147212
run: |
148213
export GITTEST_NEGOTIATE_PASSWORD="${{ secrets.GITTEST_NEGOTIATE_PASSWORD }}"
149214
150-
if [ -n "${{ matrix.platform.image }}" ]; then
215+
if [ -n "${{ matrix.platform.container.name }}" ]; then
151216
docker run \
152217
--rm \
153218
-v "$(pwd):/home/libgit2/source" \
@@ -161,12 +226,12 @@ jobs:
161226
-e PKG_CONFIG_PATH \
162227
-e SKIP_NEGOTIATE_TESTS \
163228
-e SKIP_SSH_TESTS \
229+
-e TSAN_OPTIONS \
164230
${{ env.docker-registry-container-sha }} \
165231
/bin/bash -c "mkdir build && cd build && ../ci/build.sh && ../ci/test.sh"
166232
else
167233
mkdir build && cd build
168234
../ci/build.sh
169235
../ci/test.sh
170236
fi
171-
env: ${{ matrix.platform.env }}
172237
shell: bash

0 commit comments

Comments
 (0)