-
Notifications
You must be signed in to change notification settings - Fork 37
68 lines (64 loc) · 2.26 KB
/
pr.yml
File metadata and controls
68 lines (64 loc) · 2.26 KB
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
name: PR Check
on:
pull_request:
branches:
- master
types: [opened, synchronize]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- { os: ubuntu-latest, target: linux, platform: linux-x64,}
- { os: macos-latest, target: darwin, platform: darwin-x64,}
- { os: macos-latest, target: darwin, platform: darwin-arm64}
- { os: windows-latest, target: windows, platform: win32-x64 }
steps:
- uses: actions/setup-node@v4
with:
node-version: '20'
- uses: actions/checkout@v3
- name: install gcc 11
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get install -y gcc-11 g++-11
echo "CC=gcc-11" >> $GITHUB_ENV
echo "CXX=g++-11" >> $GITHUB_ENV
- name: Build-Windows
if: startsWith(matrix.os, 'windows')
run: |
mkdir build
cd build
cmake .. -DCMAKE_USER_MAKE_RULES_OVERRIDE="${{ github.workspace }}/cmake/flags_override.cmake" -DBUILD_GMOCK=OFF -DINSTALL_GTEST=OFF
cmake --build . --config Release
ctest -V -C Release
cmake --install . --config Release --prefix ${{ github.workspace }}/artifact/
- name: Build-Linux
if: startsWith(matrix.os, 'ubuntu')
run: |
mkdir build
cd build
cmake .. -DBUILD_GMOCK=OFF -DINSTALL_GTEST=OFF -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release
ctest -V -C Release
cmake --install . --config Release --prefix ${{ github.workspace }}/artifact/
- name: Build-macosx
if: startsWith(matrix.os, 'macos')
run: |
mkdir build
cd build
if [[ "${{ matrix.platform }}" = darwin-arm64 ]]; then
cmake .. -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DBUILD_GMOCK=OFF -DINSTALL_GTEST=OFF -DCMAKE_BUILD_TYPE=Release
else
cmake .. -DBUILD_GMOCK=OFF -DINSTALL_GTEST=OFF -DCMAKE_BUILD_TYPE=Release
fi
cmake --build . --config Release
ctest -V -C Release
cmake --install . --config Release --prefix ${{ github.workspace }}/artifact/
- name: Upload
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform }}
path: ${{ github.workspace }}/artifact/