Skip to content

Commit 9408604

Browse files
authored
CTest & GitHub Actions Improvements (#381)
* Run tests in parallel in some `GitHub Actions` Workflows * Except for `macOS` & `Coverage` jobs * Update `Node.js 16` actions to `Node.js 20` versions * `actions/upload-artifact` * `actions/cache` * Add server `IP:Port` in `CTest` HTTPD logs * Make `render_speedtest_*` CTest tests require tiles to be downloaded * Add & use tile download functions for CTest * Including `check` & `remove` "tests" * To remove much of the redundant code * Split up HTTPD0/HTTPD1 downloads in CTest * Remove Amazon Linux 2/CentOS 7 from CI workflow * Comment out fedora:rawhide, it's not currently working * Re-enable CentOS Stream tests
1 parent 4143ab2 commit 9408604

12 files changed

Lines changed: 206 additions & 229 deletions

File tree

.github/actions/cmake/build/action.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@
22
runs:
33
using: composite
44
steps:
5-
- name: Create `cmake` symbolic link
6-
run: |
7-
if ! command -v cmake &> /dev/null && command -v cmake3 &> /dev/null; then
8-
ln --symbolic cmake3 /usr/bin/cmake
9-
fi
10-
shell: bash --noprofile --norc -euxo pipefail {0}
11-
125
- name: Prepare `build` directory
136
run: |
147
cmake -B build -S . \

.github/actions/cmake/test/action.yml

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,16 @@ inputs:
66
runs:
77
using: composite
88
steps:
9-
- name: Create `ctest` symbolic link
10-
run: |
11-
if ! command -v ctest &> /dev/null && command -v ctest3 &> /dev/null; then
12-
ln --symbolic ctest3 /usr/bin/ctest
13-
fi
14-
shell: bash --noprofile --norc -euxo pipefail {0}
15-
169
- name: Test `mod_tile`
17-
run: ctest ${{ inputs.options }}
18-
shell: bash --noprofile --norc -euxo pipefail {0}
19-
working-directory: build
20-
21-
- name: Archive test artifacts on failure
22-
if: failure()
2310
run: |
24-
TAR_FILENAME=${{ matrix.image || matrix.os || github.job }}-${{ matrix.compiler }}.tar.gz
25-
TAR_FILENAME=$(echo "${TAR_FILENAME}" | sed 's/:/-/g')
26-
tar -zcf ${TAR_FILENAME} tests
11+
export CTEST_PARALLEL_LEVEL=${TEST_PARALLEL_LEVEL:-$(nproc)}
12+
ctest ${{ inputs.options }}
2713
shell: bash --noprofile --norc -euxo pipefail {0}
2814
working-directory: build
2915

3016
- name: Upload test artifacts on failure
31-
if: failure()
32-
uses: actions/upload-artifact@v3
17+
uses: actions/upload-artifact@v4
3318
with:
34-
name: Test Artifacts
35-
path: build/*.tar.gz
19+
name: Test Artifacts - ${{ matrix.image || matrix.os || github.job }}-${{ matrix.compiler }}
20+
path: build/tests
21+
if: failure()

.github/actions/dependencies/build-and-install/mapnik/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ runs:
1414

1515
- name: Cache "Download `Mapnik`" & "Build `Mapnik`"
1616
id: cache-mapnik-src
17-
uses: actions/cache@v3
17+
uses: actions/cache@v4
1818
with:
1919
path: mapnik-src
2020
key: ${{ matrix.image }}-${{ matrix.compiler }}-mapnik-${{ inputs.version }}

.github/actions/dependencies/build-and-install/mapnik/latest/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ runs:
44
steps:
55
- name: Cache "Checkout `Mapnik`" & "Build `Mapnik`"
66
id: cache-mapnik
7-
uses: actions/cache@v3
7+
uses: actions/cache@v4
88
with:
99
path: |
1010
mapnik-build

.github/actions/dependencies/install/action.yml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -197,29 +197,23 @@ inputs:
197197
memcached
198198
mapnik-build-version-centos-stream:
199199
default: 3.1.0
200-
mapnik-build-version-amazonlinux2-centos7:
201-
default: 3.0.17
202200
mapnik-build-version-opensuse:
203201
default: 3.1.0
204202

205203
runs:
206204
using: composite
207205
steps:
208-
- name: Install Dependencies (Amazon Linux/CentOS/CentOS Stream)
206+
- name: Install Dependencies (CentOS Stream)
209207
uses: ./.github/actions/dependencies/install/yum
210208
with:
211209
dependencies: epel-release
212210
packages: >-
213211
${{ inputs.rhel-build-dependencies }}
214212
${{ inputs.rhel-mapnik-build-dependencies }}
215213
${{ inputs.rhel-test-dependencies }}
216-
${{ matrix.build_system == 'CMake' && 'cmake3' || 'autoconf automake redhat-rpm-config' }}
214+
${{ matrix.build_system == 'CMake' && 'cmake' || 'autoconf automake redhat-rpm-config' }}
217215
${{ matrix.compiler == 'LLVM' && 'clang' || 'gcc gcc-c++' }}
218-
${{ matrix.image == 'centos:7' && matrix.compiler == 'LLVM' && 'gcc-c++' || '' }}
219-
if: |
220-
startsWith(matrix.image, 'amazonlinux:') ||
221-
startsWith(matrix.image, 'centos:') ||
222-
startsWith(matrix.image, 'quay.io/centos/centos:stream')
216+
if: startsWith(matrix.image, 'quay.io/centos/centos:stream')
223217

224218
- name: Install Dependencies (Debian)
225219
uses: ./.github/actions/dependencies/install/apt-get
@@ -299,12 +293,6 @@ runs:
299293
shell: bash --noprofile --norc -euxo pipefail {0}
300294
if: startsWith(matrix.image, 'opensuse/')
301295

302-
- name: Build & Install `mapnik` (Amazon Linux 2/CentOS 7)
303-
uses: ./.github/actions/dependencies/build-and-install/mapnik
304-
with:
305-
version: ${{ inputs.mapnik-build-version-amazonlinux2-centos7 }}
306-
if: matrix.image == 'amazonlinux:2' || matrix.image == 'centos:7'
307-
308296
- name: Build & Install `mapnik` (CentOS Stream)
309297
uses: ./.github/actions/dependencies/build-and-install/mapnik
310298
with:

.github/actions/dependencies/install/yum/action.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@ runs:
2828
shell: bash --noprofile --norc -euxo pipefail {0}
2929
if: matrix.image == 'quay.io/centos/centos:stream9'
3030

31-
- name: Enable EPEL repository (Amazon Linux 2)
32-
run: amazon-linux-extras install epel -y
33-
shell: bash --noprofile --norc -euxo pipefail {0}
34-
if: matrix.image == 'amazonlinux:2' && contains(inputs.dependencies, 'epel-release')
35-
3631
- name: Install dependency package(s)
3732
run: |
3833
if [ -n "${{ inputs.dependencies }}" ]; then

.github/workflows/build-and-test.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@ jobs:
1515
strategy:
1616
matrix:
1717
image:
18-
- "centos:7"
1918
- "debian:11"
2019
- "debian:12"
2120
- "debian:testing"
2221
- "fedora:38"
2322
- "fedora:39"
24-
- "fedora:rawhide"
23+
# - "fedora:rawhide"
2524
- "opensuse/leap:15"
25+
- "quay.io/centos/centos:stream8"
26+
- "quay.io/centos/centos:stream9"
2627
- "ubuntu:20.04"
2728
- "ubuntu:rolling"
2829
build_system:
@@ -53,21 +54,12 @@ jobs:
5354
CXX: ${{ matrix.compiler == 'LLVM' && 'clang++' || 'g++' }}
5455
image: ${{ matrix.image }}
5556
steps:
56-
- name: Install `git` (Amazon Linux 2)
57-
run: yum --assumeyes install git
58-
if: matrix.image == 'amazonlinux:2'
59-
6057
- name: Install `git` (openSUSE)
6158
run: zypper --non-interactive install git
6259
if: startsWith(matrix.image, 'opensuse/')
6360

64-
- name: Checkout code (CentOS 7)
65-
uses: actions/checkout@v3
66-
if: matrix.image == 'centos:7'
67-
6861
- name: Checkout code
6962
uses: actions/checkout@v4
70-
if: matrix.image != 'centos:7'
7163

7264
- name: Install dependencies
7365
uses: ./.github/actions/dependencies/install
@@ -127,6 +119,7 @@ jobs:
127119
CFLAGS: -Wno-implicit-function-declaration
128120
LDFLAGS: -undefined dynamic_lookup
129121
LIBRARY_PATH: /usr/local/lib
122+
TEST_PARALLEL_LEVEL: 1
130123
name: >-
131124
${{ matrix.os }}
132125
(${{ matrix.build_system }})
@@ -178,6 +171,7 @@ jobs:
178171
BUILD_PARALLEL_LEVEL: 2
179172
CTEST_HOST: localhost
180173
LIBRARY_PATH: /usr/local/lib
174+
TEST_PARALLEL_LEVEL: 2
181175
TMPDIR: /tmp
182176
name: >-
183177
${{ matrix.box_generic }}

.github/workflows/coverage.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
BUILD_TYPE: Debug
2020
CFLAGS: --coverage
2121
CXXFLAGS: --coverage
22+
TEST_PARALLEL_LEVEL: 1
2223
strategy:
2324
matrix:
2425
compiler:
@@ -66,12 +67,13 @@ jobs:
6667

6768
- name: Generate `mod_tile` coverage results artifact
6869
run: |
69-
mkdir -p coverage
70-
genhtml coverage.info --output-directory coverage/${{ matrix.mapnik_latest && 'mapnik_latest' || 'mapnik' }}
70+
genhtml coverage.info --output-directory coverage
7171
working-directory: build
7272

7373
- name: Upload `mod_tile` coverage results artifact
74-
uses: actions/upload-artifact@v3
74+
uses: actions/upload-artifact@v4
7575
with:
76-
name: Coverage Results
77-
path: build/coverage
76+
name: Coverage Results - ${{ matrix.mapnik_latest && 'mapnik_latest' || 'mapnik' }}
77+
path: |
78+
build/coverage
79+
build/coverage.info

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
git diff --patch > ArtisticStyleFormattingFixes.patch
5757
- name: Upload `ArtisticStyleFormattingFixes.patch` file
5858
if: failure()
59-
uses: actions/upload-artifact@v3
59+
uses: actions/upload-artifact@v4
6060
with:
6161
name: ArtisticStyleFormattingFixes.patch
6262
path: ArtisticStyleFormattingFixes.patch

0 commit comments

Comments
 (0)