-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (48 loc) · 2.01 KB
/
cmake.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
name: build and test
on: [push]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Debug
jobs:
build_job:
# 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
env:
PROJECT: gtest_submodule
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: einaregilsson/build-number@v3
with:
token: ${{secrets.github_token}}
- name: Install compiler and packages
shell: bash
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
run: |
sudo apt-get install -y gcc-12 g++-12 clang-14 valgrind python3-yaml cmake lcov
sudo pip install codecov
- name: Create CMake build files
working-directory: ${{github.workspace}}
shell: bash
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
run: |
CXX_FLAGS="-Wall -Werror -Wno-variadic-macros -Wno-long-long -Wno-shadow"
export CMAKE_OPTIONS="${CMAKE_OPTIONS} ${ENV_CMAKE_OPTIONS}"
export CXX_FLAGS="${CXX_FLAGS} ${ENV_CXX_FLAGS}"
cmake -B build ${CMAKE_OPTIONS} -DCMAKE_CXX_FLAGS=${CXX_FLAGS}
- name: Compile the project
working-directory: ${{github.workspace}}
shell: bash
run: |
VERBOSE=1 cmake --build build --config $BUILD_TYPE -j8
- name: Run the tests
working-directory: ${{github.workspace}}/build
shell: bash
run: |
ctest