nameof_module/.github/workflows/ubuntu.yml

70 lines
2.6 KiB
YAML
Raw Normal View History

2020-11-15 20:54:48 +00:00
name: ubuntu
on: [push, pull_request]
jobs:
ubuntu:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
compiler:
2022-01-23 15:38:38 +00:00
- { cc: "gcc-9", cxx: "g++-9" }
- { cc: "gcc-10", cxx: "g++-10" }
2022-08-12 17:38:40 +00:00
- { cc: "gcc-11", cxx: "g++-11" }
- { cc: "clang-9", cxx: "clang++-9" }
2020-11-15 20:54:48 +00:00
- { cc: "clang-10", cxx: "clang++-10" }
2021-06-21 17:49:09 +00:00
- { cc: "clang-11", cxx: "clang++-11" }
- { cc: "clang-12", cxx: "clang++-12" }
2022-08-12 17:38:40 +00:00
- { cc: "clang-13", cxx: "clang++-13" }
- { cc: "clang-14", cxx: "clang++-14" }
- { cc: "clang-15", cxx: "clang++-15" }
- { cc: "clang-16", cxx: "clang++-16" }
2020-11-15 20:54:48 +00:00
2022-08-12 17:38:40 +00:00
name: "${{matrix.compiler.cc}}"
2020-11-15 20:54:48 +00:00
steps:
- uses: actions/checkout@v3
2020-11-15 20:54:48 +00:00
2022-08-12 17:38:40 +00:00
- name: Configure clang
run: |
if [[ "${{matrix.compiler.cc}}" == "clang"* ]]; then
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
sudo apt install ${{matrix.compiler.cc}} -y
fi
2020-11-15 20:54:48 +00:00
2022-08-12 17:38:40 +00:00
- name: Configure gcc
run: |
if [[ "${{matrix.compiler.cc}}" == "gcc"* ]]; then
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt update
sudo apt install ${{matrix.compiler.cxx}} -y
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
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
cmake --build . --config Release
ctest --output-on-failure -C Release
- name: Build Debug
run: |
rm -rf build
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
cmake --build . --config Debug
ctest --output-on-failure -C Debug