-
Notifications
You must be signed in to change notification settings - Fork 1
132 lines (113 loc) · 4.63 KB
/
ci.yaml
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: CI Build & Test
# Triggers the workflow on push or pull request events
on: [push, pull_request]
permissions:
contents: read
jobs:
build:
strategy:
matrix:
include:
# macOS builds
# ~~~~~~~~~~~~
- name: macOS-12/Xcode/Debug
build_type: Debug
generator: Xcode
options: -D PEEJAY_CXX17=No
os: macos-12
- name: macOS-12/Xcode/Release
build_type: Release
generator: Xcode
options: -D PEEJAY_CXX17=No
os: macos-12
# Linux builds
# ~~~~~~~~~~~~
- name: Ubuntu-20.04/clang-8/Debug/C++17
apt_install: clang-8 cmake libc++-8-dev libc++abi-8-dev ninja-build
build_type: Debug
cxx_compiler: -DCMAKE_CXX_COMPILER=clang++-8 -DCMAKE_C_COMPILER=clang-8
generator: Ninja
options: -D PEEJAY_CXX17=Yes -D LIBCXX=Yes
os: ubuntu-20.04
- name: Ubuntu-22.04/gcc-11/Debug
apt_install: cmake ninja-build
build_type: Debug
generator: Ninja
options: -D PEEJAY_CXX17=No
os: ubuntu-22.04
- name: Ubuntu-22.04/gcc-11/Release
apt_install: cmake ninja-build
build_type: Release
generator: Ninja
options: -D PEEJAY_CXX17=No
os: ubuntu-22.04
# It's current necesssary to use libc++ because builds witb libstdc++ fail
# They fail due to this bug:
# https://github.com/llvm/llvm-project/issues/55560
- name: Ubuntu-22.04/clang-14/Debug
apt_install: clang-14 cmake libc++-dev libc++abi-dev ninja-build
build_type: Debug
cxx_compiler: -DCMAKE_CXX_COMPILER=clang++-14 -DCMAKE_C_COMPILER=clang-14
generator: Ninja
options: -D PEEJAY_CXX17=No -DLIBCXX=Yes '-DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=gold'
os: ubuntu-22.04
- name: Ubuntu-22.04/clang-14/Release
apt_install: clang-14 cmake libc++-dev libc++abi-dev ninja-build
build_type: Release
cxx_compiler: -DCMAKE_CXX_COMPILER=clang++-14 -DCMAKE_C_COMPILER=clang-14
generator: Ninja
options: -D PEEJAY_CXX17=No -DLIBCXX=Yes '-DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=gold'
os: ubuntu-22.04
- name: Ubuntu-22.04/clang-14/Release/C++17
apt_install: clang-14 cmake ninja-build
build_type: Release
cxx_compiler: -DCMAKE_CXX_COMPILER=clang++-14 -DCMAKE_C_COMPILER=clang-14
generator: Ninja
options: -DPEEJAY_CXX17=Yes -DLIBCXX=Yes -DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=gold
os: ubuntu-22.04
# Windows builds
# ~~~~~~~~~~~~~~
- name: Windows-latest/VS2022/Debug
build_type: Debug
generator: Visual Studio 17 2022
options: -D PEEJAY_CXX17=No
os: windows-latest
- name: Windows-latest/VS2022/Release
build_type: Release
generator: Visual Studio 17 2022
options: -D PEEJAY_CXX17=No
os: windows-latest
- name: Windows-latest/VS2022/Debug/C++17
build_type: Debug
generator: Visual Studio 17 2022
options: -D PEEJAY_CXX17=Yes
os: windows-latest
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
submodules: 'True'
- name: Install Dependencies (Linux)
if: startsWith (matrix.os, 'ubuntu-') && matrix.apt_install != ''
run: sudo apt-get update && sudo apt-get install -y ${{ matrix.apt_install }}
- name: Create Build Environment
run: cmake -E make_directory ${{ github.workspace }}/build
- name: Configure CMake
shell: bash
run: |
cmake -S "$GITHUB_WORKSPACE" \
-B "${{ github.workspace }}/build" \
-G "${{ matrix.generator }}" \
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-D WERROR=Yes \
${{ matrix.cxx_compiler }} \
${{ matrix.options }}
- name: Build
shell: bash
run: cmake --build "${{ github.workspace }}/build" --config ${{ matrix.build_type }}