Skip to content

Commit 1c787e5

Browse files
committed
parallelize test on GitHub Actions uing matrix
1 parent 248f932 commit 1c787e5

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

.github/workflows/test.yml

+15-3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@ env:
1212
jobs:
1313
test:
1414
runs-on: ubuntu-latest
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
index: # see DIST_IDS and DIST_VERS lists in CMakeLists.txt
19+
- ubuntu-20.04
20+
- ubuntu-22.04
21+
- ubuntu-24.04
22+
- rocky-8.9
23+
- rocky-9.3
24+
- almalinux-9.3
25+
- alpine-3.19
26+
- arch-base
1527
steps:
1628
- uses: actions/checkout@v4
1729
with:
@@ -20,7 +32,7 @@ jobs:
2032
- name: patch to libssh
2133
run: patch -d libssh -p1 < patch/libssh-0.10.6-2-g6f1b1e76.patch
2234

23-
# TODO: just building docker does not require libssh. fix CMakeLists
35+
# TODO: just building docker images does not require libssh. fix CMakeLists
2436
- name: install build dependency
2537
run: |
2638
sudo apt-get update
@@ -30,7 +42,7 @@ jobs:
3042
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
3143

3244
- name: Build Containers
33-
run: make -C ${{github.workspace}}/build docker-build-all
45+
run: make -C ${{github.workspace}}/build docker-build-${{ matrix.index }}
3446

3547
- name: Run Test
36-
run: make -C ${{github.workspace}}/build docker-test-all
48+
run: make -C ${{github.workspace}}/build docker-test-${{ matrix.index }}

CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@ enable_testing()
165165
# Custom targets to build and test mscp in docker containers.
166166
# foreach(IN ZIP_LISTS) (cmake >= 3.17) can shorten the following lists.
167167
# However, ubuntu 20.04 has cmake 3.16.3. So this is a roundabout trick.
168+
#
169+
# When edit DIST_IDS and DIST_VERS, also edit .github/workflows/test.yaml
168170
list(APPEND DIST_IDS ubuntu ubuntu ubuntu rocky rocky almalinux alpine arch)
169171
list(APPEND DIST_VERS 20.04 22.04 24.04 8.9 9.3 9.3 3.19 base)
170172

0 commit comments

Comments
 (0)