nameof_module/.github/workflows/ubuntu.yml

77 lines
3.2 KiB
YAML
Raw Permalink Normal View History

2020-11-15 20:54:48 +00:00
name: ubuntu
on: [push, pull_request]
2023-05-27 10:07:42 +00:00
permissions: read-all
2020-11-15 20:54:48 +00:00
jobs:
ubuntu:
strategy:
fail-fast: false
matrix:
compiler:
2024-01-31 14:26:46 +00:00
- { cc: "gcc-9", cxx: "g++-9", os: "ubuntu-20.04" }
- { cc: "gcc-10", cxx: "g++-10", os: "ubuntu-20.04" }
- { cc: "gcc-10", cxx: "g++-10", os: "ubuntu-20.04" }
- { cc: "gcc-11", cxx: "g++-11", os: "ubuntu-20.04" }
- { cc: "gcc-11", cxx: "g++-11", os: "ubuntu-20.04" }
- { cc: "gcc-12", cxx: "g++-12", os: "ubuntu-22.04" }
2024-10-14 12:38:45 +00:00
- { cc: "gcc-13", cxx: "g++-12", os: "ubuntu-22.04" }
- { cc: "gcc-14", cxx: "g++-12", os: "ubuntu-22.04" }
2024-01-31 14:26:46 +00:00
- { cc: "clang-9", cxx: "clang++-9", os: "ubuntu-20.04" }
- { cc: "clang-10", cxx: "clang++-10", os: "ubuntu-20.04" }
- { cc: "clang-11", cxx: "clang++-11", os: "ubuntu-20.04" }
- { cc: "clang-12", cxx: "clang++-12", os: "ubuntu-20.04" }
- { cc: "clang-13", cxx: "clang++-13", os: "ubuntu-20.04" }
- { cc: "clang-14", cxx: "clang++-14", os: "ubuntu-20.04" }
- { cc: "clang-15", cxx: "clang++-15", os: "ubuntu-20.04" }
- { cc: "clang-16", cxx: "clang++-16", os: "ubuntu-20.04" }
2020-11-15 20:54:48 +00:00
2023-05-27 10:07:42 +00:00
name: "${{ matrix.compiler.cc }}"
2024-01-31 14:26:46 +00:00
runs-on: ${{ matrix.compiler.os }}
2020-11-15 20:54:48 +00:00
steps:
2024-01-31 14:26:46 +00:00
- uses: actions/checkout@v4
2020-11-15 20:54:48 +00:00
2022-08-12 17:38:40 +00:00
- name: Configure clang
run: |
2023-05-27 10:07:42 +00:00
if [[ "${{ matrix.compiler.cc }}" == "clang"* ]]; then
2022-08-12 17:38:40 +00:00
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
sudo apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-9 main"
sudo apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-10 main"
sudo apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-11 main"
sudo apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-12 main"
sudo apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-13 main"
sudo apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main"
sudo apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-15 main"
2023-01-31 18:49:07 +00:00
sudo apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-16 main"
2022-08-12 17:38:40 +00:00
sudo apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal main"
sudo apt update
2023-05-27 10:07:42 +00:00
sudo apt install ${{ matrix.compiler.cc }} -y
2022-08-12 17:38:40 +00:00
fi
2020-11-15 20:54:48 +00:00
2022-08-12 17:38:40 +00:00
- name: Configure gcc
run: |
2023-05-27 10:07:42 +00:00
if [[ "${{ matrix.compiler.cc }}" == "gcc"* ]]; then
2022-08-12 17:38:40 +00:00
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt update
2023-05-27 10:07:42 +00:00
sudo apt install ${{ matrix.compiler.cxx }} -y
2022-08-12 17:38:40 +00:00
fi
2020-11-15 20:54:48 +00:00
2022-08-12 17:38:40 +00:00
- name: Build Release
run: |
rm -rf build
mkdir build
cd build
2023-05-27 10:07:42 +00:00
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }}
cmake --build . -j 4 --config Release
2022-08-12 17:38:40 +00:00
ctest --output-on-failure -C Release
- name: Build Debug
run: |
rm -rf build
mkdir build
cd build
2023-05-27 10:07:42 +00:00
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }}
cmake --build . -j 4 --config Debug
2022-08-12 17:38:40 +00:00
ctest --output-on-failure -C Debug