-
Notifications
You must be signed in to change notification settings - Fork 2
80 lines (73 loc) · 2.62 KB
/
Copy pathcpp.yml
File metadata and controls
80 lines (73 loc) · 2.62 KB
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
72
73
74
75
76
77
78
79
80
# To debug a workflow see: https://docs.github.com/en/actions/configuring-and-managing-workflows/managing-a-workflow-run#enabling-debug-logging
name: C++ CI
on:
push:
schedule:
- cron: '0 2 * * SAT'
jobs:
build-cpp-unix:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: Linux GCC 11
os: ubuntu-20.04
c-compiler: gcc-11
cxx-compiler: g++-11
- name: Linux Clang 12
os: ubuntu-20.04
c-compiler: clang-12
cxx-compiler: clang++-12
- name: macOS 12
os: macOS-12
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
with:
submodules: true
- name: install GCC-11
run: |
sudo apt install -qy software-properties-common
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt install -qy gcc-11 g++-11
if: matrix.c-compiler == 'gcc-11' && runner.os == 'Linux'
- name: install Clang-12
run: |
# for sources, see https://apt.llvm.org
curl -Ls 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-12 main'
sudo apt update && sudo apt install -qy clang-12 libc++-12-dev libc++abi-12-dev
if: matrix.c-compiler == 'clang-12' && runner.os == 'Linux'
- name: install additional tools and libs
run: |
if [ "${{runner.os}}" == "Linux" ]; then
# libunwind-dev sometimes required to work around cxx_feature_check(STD_REGEX) for Google Benchmark
sudo apt install -y libtbb-dev ninja-build libunwind-dev
fi
if [ "${{runner.os}}" == "macOS" ]; then
brew install ninja
fi
- name: configure
run: |
echo "Configure on $(uname -a)"
cd cpp && mkdir build && cd build && CC=${{matrix.c-compiler}} CXX=${{matrix.cxx-compiler}} cmake .. -G Ninja
- name: build
run: cd cpp && cmake --build build
- name: test
run: cd cpp/build && ctest
build-cpp-windows:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ windows-latest ]
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: configure
run: cd cpp && mkdir build && cd build && cmake ..
- name: build
run: cd cpp && cmake --build build --config Debug
- name: test
run: cd cpp/build && ctest -C Debug