Github actions: Modernize CI workflow #22
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
name: CI | |
on: [ push, pull_request ] | |
jobs: | |
linux: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
name: [Ubuntu-20, Ubuntu-22, Ubuntu-24, Debian-10, Debian-11, Debian-12, Debian-Testing, Debian-Experimental, Fedora-38, Fedora-39, Fedora-40] | |
build_type: [Dev] | |
cpp_compiler: [g++] | |
cpp_version: [c++11] | |
include: | |
- name: Ubuntu-20 | |
# Uses gcc 9.3.0, clang 10.0.0, cmake 3.16.3 | |
image: "ubuntu:20.04" | |
ubuntu: 20 | |
- name: Ubuntu-22 | |
# Uses gcc 12.2.0, clang 15.0.7, cmake 3.24.2 | |
image: "ubuntu:22.04" | |
ubuntu: 22 | |
CXXFLAGS: -Wno-stringop-overread | |
- name: Ubuntu-24 | |
image: "ubuntu:24.04" | |
ubuntu: 24 | |
CXXFLAGS: -Wno-stringop-overread | |
- name: Debian-10 | |
# Uses gcc 8.3.0, clang 7.0.1, cmake 3.13.4 | |
image: "debian:buster" | |
- name: Debian-11 | |
# Uses gcc 10.2.1, clang 11.0.1, cmake 3.18.4 | |
image: "debian:bullseye" | |
- name: Debian-11 | |
image: "debian:bullseye" | |
cpp_version: c++17 | |
- name: Debian-11 | |
image: "debian:bullseye" | |
cpp_version: c++20 | |
- name: Debian-11 | |
image: "debian:bullseye" | |
c_compiler: clang | |
cpp_compiler: clang++ | |
- name: Debian-11 | |
image: "debian:bullseye" | |
c_compiler: clang | |
cpp_compiler: clang++ | |
cpp_version: c++17 | |
- name: Debian-11 | |
image: "debian:bullseye" | |
c_compiler: clang | |
cpp_compiler: clang++ | |
cpp_version: c++20 | |
- name: Debian-11 | |
image: "debian:bullseye" | |
build_type: RelWithDebInfo | |
- name: Debian-11 | |
image: "debian:bullseye" | |
c_compiler: clang | |
cpp_compiler: clang++ | |
CXXFLAGS: -fsanitize=address,undefined,integer -fno-sanitize-recover=all -fno-omit-frame-pointer | |
LDFLAGS: -fsanitize=address,undefined,integer | |
- name: Debian-12 | |
# Uses gcc 12.2.0, clang 15.0.6, cmake 3.25.1 | |
image: "debian:bookworm" | |
CXXFLAGS: -Wno-stringop-overread | |
- name: Debian-12 | |
image: "debian:bookworm" | |
cpp_version: c++17 | |
CXXFLAGS: -Wno-stringop-overread | |
- name: Debian-12 | |
image: "debian:bookworm" | |
cpp_version: c++20 | |
CXXFLAGS: -Wno-stringop-overread | |
- name: Debian-12 | |
image: "debian:bookworm" | |
c_compiler: clang | |
cpp_compiler: clang++ | |
- name: Debian-12 | |
image: "debian:bookworm" | |
c_compiler: clang | |
cpp_compiler: clang++ | |
cpp_version: c++17 | |
- name: Debian-12 | |
image: "debian:bookworm" | |
c_compiler: clang | |
cpp_compiler: clang++ | |
cpp_version: c++20 | |
- name: Debian-12 | |
image: "debian:bookworm" | |
build_type: RelWithDebInfo | |
CXXFLAGS: -Wno-stringop-overread | |
- name: Debian-12 | |
image: "debian:bookworm" | |
c_compiler: clang | |
cpp_compiler: clang++ | |
CXXFLAGS: -fsanitize=address,undefined,integer -fno-sanitize-recover=all -fno-omit-frame-pointer | |
LDFLAGS: -fsanitize=address,undefined,integer | |
- name: Debian-Testing | |
image: "debian:testing" | |
CXXFLAGS: -Wno-stringop-overread | |
- name: Debian-Testing | |
image: "debian:testing" | |
c_compiler: clang | |
cpp_compiler: clang++ | |
- name: Debian-Experimental | |
image: "debian:experimental" | |
CXXFLAGS: -Wno-stringop-overread | |
- name: Debian-Experimental | |
image: "debian:experimental" | |
c_compiler: clang | |
cpp_compiler: clang++ | |
- name: Fedora-38 | |
# Uses gcc 13.0.1, clang 16.0.5, cmake 3.26.4 | |
image: "fedora:38" | |
CXXFLAGS: -Wno-stringop-overread | |
- name: Fedora-39 | |
image: "fedora:39" | |
CXXFLAGS: -Wno-stringop-overread | |
- name: Fedora-40 | |
image: "fedora:40" | |
CXXFLAGS: -Wno-stringop-overread | |
container: | |
image: ${{ matrix.image }} | |
env: | |
LANG: en_US.UTF-8 | |
BUILD_TYPE: ${{ matrix.build_type }} | |
CC: ${{ matrix.c_compiler }} | |
CXX: ${{ matrix.cpp_compiler }} | |
CXXFLAGS: ${{ matrix.CXXFLAGS }} | |
LDFLAGS: ${{ matrix.LDFLAGS }} | |
CPP_VERSION: ${{ matrix.cpp_version }} | |
APT_LISTCHANGES_FRONTEND: none | |
DEBIAN_FRONTEND: noninteractive | |
steps: | |
- name: Prepare container (apt) | |
shell: bash | |
if: startsWith(matrix.image, 'debian:') || startsWith(matrix.image, 'ubuntu:') | |
run: | | |
apt-get update -qq | |
apt-get install -yq \ | |
clang \ | |
cmake \ | |
g++ \ | |
git \ | |
libboost-dev \ | |
libboost-filesystem-dev \ | |
libboost-program-options-dev \ | |
libbz2-dev \ | |
libexpat1-dev \ | |
libgdal-dev \ | |
liblz4-dev \ | |
libproj-dev \ | |
make \ | |
zlib1g-dev | |
- name: Install compiler | |
shell: bash | |
if: matrix.cpp_compiler == 'clang++-14' | |
run: apt-get install -yq clang-14 | |
- name: Prepare container (dnf) | |
shell: bash | |
if: startsWith(matrix.image, 'fedora:') | |
run: | | |
dnf install --quiet --assumeyes \ | |
boost-devel \ | |
bzip2-devel \ | |
cmake \ | |
expat-devel \ | |
gcc-c++ \ | |
gdal-devel \ | |
git \ | |
lz4-devel \ | |
make \ | |
proj-devel \ | |
zlib-devel | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/install-from-git | |
- uses: ./.github/actions/cmake | |
- uses: ./.github/actions/build | |
- uses: ./.github/actions/ctest | |
ubuntu-latest: | |
runs-on: ubuntu-22.04 | |
env: | |
CC: clang-15 | |
CXX: clang++-15 | |
BUILD_TYPE: Dev | |
steps: | |
- name: Install new clang | |
run: | | |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/llvm-snapshot.asc | |
sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main' | |
sudo apt-get update -qq | |
sudo apt-get install -yq clang-15 | |
shell: bash | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/install-ubuntu | |
- uses: ./.github/actions/install-from-git | |
- uses: ./.github/actions/cmake | |
- uses: ./.github/actions/build | |
- uses: ./.github/actions/ctest | |
- uses: ./.github/actions/build-sub | |
macos: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- "macos-12" | |
- "macos-13" | |
- "macos-14" | |
build_type: [Dev] | |
include: | |
- os: "macos-12" | |
build_type: Release | |
runs-on: ${{ matrix.os }} | |
env: | |
CC: clang | |
CXX: clang++ | |
CXXFLAGS: -std=c++14 | |
BUILD_TYPE: ${{ matrix.build_type }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/install-macos | |
- uses: ./.github/actions/install-from-git | |
- uses: ./.github/actions/cmake | |
- uses: ./.github/actions/build | |
- uses: ./.github/actions/ctest | |
- uses: ./.github/actions/build-sub | |