-
Notifications
You must be signed in to change notification settings - Fork 4
80 lines (73 loc) · 2.51 KB
/
test-base.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
name: Run Tests
on:
pull_request:
branches:
- "**"
jobs:
test-native:
runs-on: ${{ matrix.platform.os }}
strategy:
matrix:
# platforms needed to combine presets and os
platform:
- os: windows-latest
preset: patomic-ci-windows-msvc -A Win32
- os: windows-latest
preset: patomic-ci-windows-msvc -A x64
- os: macos-latest
preset: patomic-ci-unix-clang
- os: ubuntu-latest
preset: patomic-ci-unix-clang
- os: ubuntu-latest
preset: patomic-ci-unix-clang-ansi
- os: ubuntu-latest
preset: patomic-ci-unix-gcc
- os: ubuntu-latest
preset: patomic-ci-unix-gcc-ansi
# verbose labels make things easier to read in GitHub Actions
build-type:
- debug
- release
build-shared:
- static
- shared
# convert matrix options to cmake options
include:
- build-type: debug
cmake-build-type: Debug
- build-type: release
cmake-build-type: Release
- build-shared: static
cmake-build-shared: OFF
- build-shared: shared
cmake-build-shared: ON
steps:
- name: Checkout patomic
uses: actions/checkout@v4
with:
path: patomic
- name: Checkout GoogleTest
uses: actions/checkout@v4
with:
repository: google/googletest
path: googletest
- name: Build and Install GoogleTest
run: |
cd googletest
cp ../patomic/CMakePresets.json .
mkdir build
cd build
cmake --preset ${{ matrix.platform.preset }} -DCMAKE_CXX_FLAGS="" -DBUILD_SHARED_LIBS=${{ matrix.cmake-build-shared }} -DCMAKE_BUILD_TYPE=${{ matrix.cmake-build-type }} ..
cmake --build . --config ${{ matrix.cmake-build-type }}
cmake --install . --config ${{ matrix.cmake-build-type }} --prefix install
- name: Build patomic
run: |
cd patomic
mkdir build
cd build
cmake --preset ${{ matrix.platform.preset }} -DBUILD_SHARED_LIBS=${{ matrix.cmake-build-shared }} -DCMAKE_BUILD_TYPE=${{ matrix.cmake-build-type }} -DGTest_DIR:PATH="../../googletest/build/install/lib/cmake/GTest" ..
cmake --build . --config ${{ matrix.cmake-build-type }}
- name: Test patomic
run: |
cd patomic/build
ctest -C ${{ matrix.cmake-build-type }} .