-
Notifications
You must be signed in to change notification settings - Fork 0
164 lines (137 loc) · 5.63 KB
/
build_and_test.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
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
name: build-and-test
on:
push:
branches: ["master", "devel"]
pull_request:
branches: ["master"]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
ubuntu:
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: awalsh128/cache-apt-pkgs-action@v1.3.0
with:
packages: libcurl4-openssl-dev libcrypto++-dev ninja-build
- name: Install boost
uses: MarkusJx/install-boost@v2.4.5
id: install-boost
with:
# REQUIRED: Specify the required boost version
# A list of supported versions can be found here:
# https://github.com/MarkusJx/prebuilt-boost/blob/main/versions-manifest.json
boost_version: 1.83.0
# OPTIONAL: Specify a platform version
platform_version: 22.04
- name: Dump Tooling Versions
run: |
clang++ --version
cmake --version
ninja --version
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build/clang_${{env.BUILD_TYPE}} -G"Ninja" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_FLAGS="-stdlib=libc++" -DROAR_BUILD_TESTS=on -DCMAKE_CXX_EXTENSIONS=on -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_LINKER=lld -DCMAKE_CXX_STANDARD=20
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
- name: Build
run: cmake --build ${{github.workspace}}/build/clang_${{env.BUILD_TYPE}} --config ${{env.BUILD_TYPE}}
- name: Test
working-directory: ${{github.workspace}}/build/clang_${{env.BUILD_TYPE}}
run: ./tests/bin/roar-tests
ubuntu20:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: awalsh128/cache-apt-pkgs-action@v1.3.0
with:
packages: libcurl4-openssl-dev libcrypto++-dev ninja-build
- name: Install boost
uses: MarkusJx/install-boost@v2.4.5
id: install-boost
with:
# REQUIRED: Specify the required boost version
# A list of supported versions can be found here:
# https://github.com/MarkusJx/prebuilt-boost/blob/main/versions-manifest.json
boost_version: 1.83.0
# OPTIONAL: Specify a platform version
platform_version: 20.04
- name: Setup clang
uses: egor-tensin/setup-clang@v1
with:
version: 15
platform: x64
- name: Configure CMake
run: >
cmake
-B ${{github.workspace}}/build/clang_${{env.BUILD_TYPE}}
-G"Ninja"
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
-DROAR_BUILD_TESTS=on
-DCMAKE_CXX_EXTENSIONS=on
-DCMAKE_CXX_COMPILER=c++
-DCMAKE_C_COMPILER=cc
-DCMAKE_CXX_STANDARD=20
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
- name: Build
run: cmake --build ${{github.workspace}}/build/clang_${{env.BUILD_TYPE}} --config ${{env.BUILD_TYPE}}
windows-msys2:
runs-on: windows-2022
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v3
- uses: msys2/setup-msys2@v2
with:
msystem: clang64
release: true
install: mingw-w64-clang-x86_64-clang make unzip mingw-w64-clang-x86_64-cmake mingw-w64-clang-x86_64-boost mingw-w64-clang-x86_64-crypto++ libcurl mingw-w64-clang-x86_64-ninja
- name: Workspace Path Fixup
run: echo "WSPACE=$(cygpath '${{github.workspace}}')" >> $GITHUB_ENV
- name: Configure CMake
run: >
cmake
-B ${{env.WSPACE}}/build/clang_${{env.BUILD_TYPE}}
-G"Ninja"
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
-DROAR_BUILD_TESTS=on
-DCMAKE_CXX_EXTENSIONS=on
-DCMAKE_CXX_COMPILER=clang++
-DCMAKE_C_COMPILER=clang
-DCMAKE_LINKER=lld
-DCMAKE_CXX_STANDARD=20
- name: Build
run: cmake --build ${{env.WSPACE}}/build/clang_${{env.BUILD_TYPE}} --config ${{env.BUILD_TYPE}}
macos:
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- run: brew install ninja boost cryptopp curl llvm@16
- name: Get Brew Prefix
run: |
echo "BREW_PREFIX=$(brew --prefix)" >> $GITHUB_ENV
- name: Set Env Vars
run: |
echo "export LDFLAGS=-L$BREW_PREFIX/lib" >> $GITHUB_ENV
echo "export CPPFLAGS=-I$BREW_PREFIX/include" >> $GITHUB_ENV
- name: Configure CMake
run: >
cmake
-DCMAKE_C_COMPILER=$BREW_PREFIX/opt/llvm@16/bin/clang
-DCMAKE_CXX_COMPILER=$BREW_PREFIX/opt/llvm@16/bin/clang++
-DCMAKE_LINKER=$BREW_PREFIX/opt/llvm@16/bin/lld
-DROAR_BUILD_TESTS=on
-S ${{github.workspace}}
-B ${{github.workspace}}/build/clang_${{env.BUILD_TYPE}}
-G"Ninja"
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
-DBREW_PREFIX="$BREW_PREFIX"
-DCMAKE_CXX_EXTENSIONS=on
-DCMAKE_CXX_STANDARD=20
- name: Build
run: cmake --build ${{github.workspace}}/build/clang_${{env.BUILD_TYPE}} --config ${{env.BUILD_TYPE}}