Update CI for deprecation of Ubuntu 20.04 #3151
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GitHub Actions for GEOS | |
# | |
# Paul Ramsey <pramsey at cleverelephant dot ca> | |
# Based on AZP configuration by Mateusz Loskot <mateusz at loskot dot net> | |
name: 'CI' | |
on: | |
push: | |
paths-ignore: | |
- 'web/**' | |
pull_request: | |
paths-ignore: | |
- '**/.md' | |
env: | |
CCACHE_BASEDIR: ${{ github.workspace }} | |
CCACHE_DIR: ${{ github.workspace }}/.ccache | |
CCACHE_COMPRESS: "true" | |
CCACHE_COMPRESSLEVEL: "6" | |
CCACHE_MAXSIZE: "300M" | |
jobs: | |
linux: | |
name: 'Linux' | |
strategy: | |
matrix: | |
ci: | |
- cxx_compiler: g++ | |
c_compiler: gcc | |
build_type: Coverage | |
cxxstd: 14 | |
arch: 64 | |
packages: g++ | |
cmake: 3.15.* | |
cmake_extra: '-DBUILD_BENCHMARKS=ON' | |
os: ubuntu-latest | |
# gcc 9 and lower are not supported | |
# in ubuntu 22.04 and higher | |
- cxx_compiler: g++-10 | |
c_compiler: gcc-10 | |
build_type: Release | |
cxxstd: 17 | |
arch: 64 | |
packages: 'g++-10-multilib gcc-10-multilib' | |
cmake: 3.15.* | |
os: ubuntu-22.04 | |
- cxx_compiler: g++-11 | |
c_compiler: gcc-11 | |
build_type: Release | |
cxxstd: 17 | |
arch: 64 | |
packages: 'g++-11-multilib gcc-11-multilib' | |
cmake: 3.22.* | |
os: ubuntu-22.04 | |
- cxx_compiler: g++-12 | |
c_compiler: gcc-12 | |
build_type: Release | |
cxxstd: 20 | |
arch: 64 | |
packages: 'g++-12-multilib gcc-12-multilib' | |
cmake: 3.22.* | |
os: ubuntu-22.04 | |
# gcc 12 and lower are not supported | |
# in ubuntu 24.04 and higher | |
- cxx_compiler: g++-13 | |
c_compiler: gcc-13 | |
build_type: Release | |
cxxstd: 20 | |
arch: 64 | |
packages: 'g++-13-multilib gcc-13-multilib' | |
cmake: 3.25.* | |
os: ubuntu-24.04 | |
- cxx_compiler: g++-14 | |
c_compiler: gcc-14 | |
build_type: Release | |
cxxstd: 20 | |
arch: 64 | |
packages: 'g++-14-multilib gcc-14-multilib' | |
cmake: 3.31.* | |
os: ubuntu-24.04 | |
# clang 10 and lower are not supported | |
# in ubuntu 22.04 and higher | |
- cxx_compiler: clang++-11 | |
c_compiler: clang-11 | |
build_type: Debug | |
cxxstd: 14 | |
arch: 64 | |
packages: 'clang-11' | |
cmake: 3.25.* | |
os: ubuntu-22.04 | |
- cxx_compiler: clang++-12 | |
c_compiler: clang-12 | |
build_type: ASAN | |
cxxstd: 14 | |
arch: 64 | |
packages: 'clang-12' | |
cmake: 3.25.* | |
os: ubuntu-22.04 | |
- cxx_compiler: clang++-13 | |
c_compiler: clang-13 | |
build_type: ASAN | |
cxxstd: 17 | |
arch: 64 | |
packages: 'clang-13' | |
cmake: 3.25.* | |
os: ubuntu-22.04 | |
- cxx_compiler: clang++-14 | |
c_compiler: clang-14 | |
build_type: ASAN | |
cxxstd: 20 | |
arch: 64 | |
packages: 'clang-14' | |
cmake: 3.25.* | |
os: ubuntu-22.04 | |
- cxx_compiler: clang++-15 | |
c_compiler: clang-15 | |
build_type: ASAN | |
cxxstd: 20 | |
arch: 64 | |
packages: 'clang-15' | |
cmake: 3.24.* | |
os: ubuntu-22.04 | |
runs-on: ${{ matrix.ci.os }} | |
steps: | |
- name: 'Install' | |
run: | | |
set -e | |
uname -a | |
sudo -E apt-get update | |
sudo -E apt-get -yq --no-install-suggests --no-install-recommends install make doxygen python3-pip ccache valgrind ${{ matrix.ci.packages }} | |
python3 -m pip install --disable-pip-version-check --user cmake==${{ matrix.ci.cmake }} | |
echo "$(python3 -m site --user-base)/bin" >> $GITHUB_PATH | |
- name: 'Check Out' | |
uses: actions/checkout@v4 | |
- name: Retrieve build cache | |
uses: actions/cache/restore@v4 | |
id: restore-cache | |
with: | |
path: .ccache | |
key: ${{ matrix.ci.os }}-${{ matrix.ci.cxx_compiler }}-${{ matrix.ci.build_type}}-${{ matrix.ci.cxxstd }}-${{ matrix.ci.arch }}-${{ github.ref_name }}-${{ github.run_id }} | |
restore-keys: ${{ matrix.ci.os }}-${{ matrix.ci.cxx_compiler }}-${{ matrix.ci.build_type}}-${{ matrix.ci.cxxstd }}-${{ matrix.ci.arch }} | |
- name: 'Build' | |
env: | |
CFLAGS: "-m${{ matrix.ci.arch }}" | |
CXXFLAGS: "-m${{ matrix.ci.arch }}" | |
run: | | |
set -e | |
mkdir build.cmake | |
cd build.cmake | |
cmake --version | |
cmake ${{ matrix.ci.cmake_extra }} \ | |
-DCMAKE_C_COMPILER=${{ matrix.ci.c_compiler }} \ | |
-DCMAKE_CXX_COMPILER=${{ matrix.ci.cxx_compiler }} \ | |
-DCMAKE_CXX_STANDARD=${{ matrix.ci.cxxstd }} \ | |
-DUSE_CCACHE=ON \ | |
-DBUILD_DOCUMENTATION=YES \ | |
-DCMAKE_BUILD_TYPE=${{ matrix.ci.build_type }} .. | |
make -j 2 | |
cmake --build . --target docs | |
ccache -s | |
- name: Save build cache | |
uses: actions/cache/save@v4 | |
with: | |
path: .ccache | |
key: ${{ steps.restore-cache.outputs.cache-primary-key }} | |
- name: Test | |
run: | | |
set -e | |
cd build.cmake | |
ctest --output-on-failure . | |
# Run the all-unit-tests under | |
# the memory checker when we have Debug symbols | |
# available. Change to ^all to also check all-xml-tests | |
- name: Valgrind | |
if: matrix.ci.build_type == 'Debug' | |
run: | | |
set -e | |
cd build.cmake | |
ctest --output-on-failure \ | |
--overwrite MemoryCheckCommandOptions="--leak-check=full --error-exitcode=100" \ | |
-R ^all-unit -C Valgrind -T memcheck | |
- name: 'Upload Valgrind Log' | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: valgrind-log | |
path: build.cmake/Testing/Temporary/MemoryChecker.**.log | |
retention-days: 1 | |
- name: Upload Coverage to Codecov | |
if: matrix.ci.build_type == 'Coverage' | |
run: | | |
curl -o codecov.sh https://codecov.io/bash | |
bash codecov.sh | |
shell: bash | |
windows-mingw: | |
name: 'Windows (mingw-w64, x86_64, windows-2019)' | |
runs-on: windows-2019 | |
defaults: | |
run: | |
shell: msys2 {0} | |
strategy: | |
matrix: | |
build_type: ['Debug', 'Release'] | |
steps: | |
- name: 'Check Out' | |
uses: actions/checkout@v4 | |
- name: 'Setup' | |
uses: msys2/setup-msys2@v2 | |
with: | |
install: mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake make mingw-w64-x86_64-ccache | |
update: true | |
- name: Retrieve build cache | |
id: restore-cache | |
uses: actions/cache/restore@v4 | |
with: | |
path: .ccache | |
key: windows-mingw-${{ matrix.build_type}}-${{ github.ref_name }}-${{ github.run_id }} | |
restore-keys: windows-mingw-${{ matrix.build_type}} | |
- name: 'Build' | |
run: | | |
export CCACHE_BASE_DIR=$(pwd) | |
mkdir build | |
cd build | |
cmake --version | |
cmake \ | |
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ | |
-DUSE_CCACHE=ON \ | |
-G"MSYS Makefiles" .. | |
cmake --build . -j 2 | |
- name: Save build cache | |
uses: actions/cache/save@v4 | |
with: | |
path: .ccache | |
key: ${{ steps.restore-cache.outputs.cache-primary-key }} | |
- name: 'Test' | |
run: | | |
cd build | |
ctest --output-on-failure . | |
windows-msvc: | |
name: 'Windows (Visual Studio)' | |
strategy: | |
matrix: | |
ci: | |
- build_type: Debug | |
cxxstd: 14 | |
os: windows-2022 | |
- build_type: Release | |
cxxstd: 14 | |
os: windows-2019 | |
runs-on: ${{ matrix.ci.os }} | |
steps: | |
- name: 'Check Out' | |
uses: actions/checkout@v4 | |
- name: 'Setup' | |
run: choco install ccache | |
- name: Retrieve build cache | |
id: restore-cache | |
uses: actions/cache/restore@v4 | |
with: | |
path: .ccache | |
key: windows-msvc-${{ matrix.build_type}}-${{ github.ref_name }}-${{ github.run_id }} | |
restore-keys: windows-msvc-${{ matrix.build_type}} | |
- name: 'Build' | |
run: | | |
mkdir build | |
cd build | |
cmake --version | |
cmake -DCMAKE_BUILD_TYPE=${{ matrix.ci.build_type }} -DCMAKE_CXX_STANDARD=${{ matrix.ci.cxxstd }} -DBUILD_SHARED_LIBS=ON -DUSE_CCACHE=ON .. | |
cmake --build . --config ${{ matrix.ci.build_type }} -j 2 | |
- name: Save build cache | |
uses: actions/cache/save@v4 | |
with: | |
path: .ccache | |
key: ${{ steps.restore-cache.outputs.cache-primary-key }} | |
- name: 'Test' | |
run: | | |
cd build | |
ctest --output-on-failure -C ${{ matrix.ci.build_type }} | |
macos: | |
name: 'macOS clang' | |
strategy: | |
matrix: | |
include: | |
- xcode: 13.2.1 | |
cxxstd: 14 | |
build_type: ASAN | |
runs_on: macos-12 | |
- xcode: 14.3.1 | |
cxxstd: 17 | |
build_type: ASAN | |
runs_on: macos-13 | |
- xcode: 15.4 | |
cxxstd: 20 | |
build_type: Release | |
runs_on: macOS-14 | |
- xcode: 16.0 | |
cxxstd: 20 | |
build_type: Release | |
runs_on: macOS-15 | |
runs-on: ${{ matrix.runs_on }} | |
steps: | |
- name: 'Setup' | |
run: | | |
brew install ccache | |
- name: 'Install' | |
env: | |
XCODE_APP: /Applications/XCode_${{ matrix.xcode }}.app | |
run: | | |
set -e | |
uname -a | |
sudo xcode-select -switch ${XCODE_APP} | |
which clang++ | |
clang++ --version | |
- name: 'Check Out' | |
uses: actions/checkout@v4 | |
- name: Retrieve build cache | |
id: restore-cache | |
uses: actions/cache/restore@v4 | |
with: | |
path: .ccache | |
key: ${{ runner.os }}-${{ matrix.xcode }}-${{ matrix.build_type}}-${{ matrix.cxxstd }}-${{ github.ref_name }}-${{ github.run_id }} | |
restore-keys: ${{ runner.os }}-${{ matrix.xcode }}-${{ matrix.build_type}}-${{ matrix.cxxstd }} | |
- name: 'Build' | |
run: | | |
set -e | |
mkdir build | |
cd build | |
cmake --version | |
cmake \ | |
-D CMAKE_CXX_STANDARD=${{ matrix.cxxstd }} \ | |
-D USE_CCACHE=ON \ | |
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \ | |
.. | |
cmake --build . --config ${{ matrix.build_type }} -j 4 | |
ccache --show-stats | |
- name: Save build cache | |
uses: actions/cache/save@v4 | |
with: | |
path: .ccache | |
key: ${{ steps.restore-cache.outputs.cache-primary-key }} | |
- name: 'Test' | |
run: | | |
cd build | |
ctest -V --output-on-failure -C ${{ matrix.build_type }} | |
code-quality: | |
name: Code quality checks | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install | |
run: | | |
set -e | |
sudo -E apt-get update | |
sudo -E apt-get -yq --no-install-suggests --no-install-recommends install cppcheck | |
- name: 'Check Out' | |
uses: actions/checkout@v4 | |
- name: 'cppcheck' | |
run: | | |
./tools/cppcheck.sh | |