-
Notifications
You must be signed in to change notification settings - Fork 111
71 lines (63 loc) · 2.67 KB
/
ubuntu.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: ubuntu
on: [push, pull_request]
permissions: read-all
jobs:
ubuntu:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
compiler:
- { cc: "gcc-9", cxx: "g++-9" }
- { cc: "gcc-10", cxx: "g++-10" }
- { cc: "gcc-11", cxx: "g++-11" }
- { cc: "clang-9", cxx: "clang++-9" }
- { cc: "clang-10", cxx: "clang++-10" }
- { cc: "clang-11", cxx: "clang++-11" }
- { cc: "clang-12", cxx: "clang++-12" }
- { cc: "clang-13", cxx: "clang++-13" }
- { cc: "clang-14", cxx: "clang++-14" }
- { cc: "clang-15", cxx: "clang++-15" }
- { cc: "clang-16", cxx: "clang++-16" }
name: "${{ matrix.compiler.cc }}"
steps:
- uses: actions/checkout@v3
- 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"
sudo apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-16 main"
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
- 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
- name: Build Release
run: |
rm -rf build
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }}
cmake --build . -j 4 --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 . -j 4 --config Debug
ctest --output-on-failure -C Debug