forked from WG21-SG14/SG14
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (54 loc) · 1.68 KB
/
build-and-run-tests.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
name: Build and run tests
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
build_type: [Debug]
cpp_compiler: [g++, clang++, cl]
cpp_standard: [14]
exclude:
- os: ubuntu-latest
cpp_compiler: clang++
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install Google Test (Linux)
if: matrix.os == 'ubuntu-latest'
run: >
sudo apt-get install libgtest-dev
- name: Install Google Test (Windows)
if: matrix.os == 'windows-latest'
run: >
git clone https://github.com/google/googletest.git &&
mkdir googletest/build &&
cd googletest/build &&
cmake .. -G 'Unix Makefiles' &&
make install
- name: Build (Linux)
if: matrix.os == 'ubuntu-latest'
working-directory: ${{ github.workspace }}
env:
CMAKE_CXX_COMPILER: ${{ matrix.cpp_compiler }}
CMAKE_BUILD_TYPE: ${{ matrix.build_type }}
run: |
cmake -S . -B ./build -DCMAKE_CXX_STANDARD=${{ matrix.cpp_standard }}
- name: Build (Windows)
if: matrix.os == 'windows-latest'
working-directory: ${{ github.workspace }}
env:
CMAKE_CXX_COMPILER: ${{ matrix.cpp_compiler }}
CMAKE_BUILD_TYPE: ${{ matrix.build_type }}
run: |
cmake -S . -B ./build -DCMAKE_CXX_STANDARD=${{ matrix.cpp_standard }}
# -DGTEST_ROOT="C:/Program Files (x86)/googletest-distribution"
- name: Test
working-directory: ${{ github.workspace }}/build
run: |
make && ./bin/utest