forked from BasedInc/libhat
-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (77 loc) · 2.66 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
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
name: CMake
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
env:
BUILD_TYPE: Debug
jobs:
macos:
strategy:
matrix:
cxx_standard: [ 20, 23 ]
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Configure
run: cmake -B ${{github.workspace}}/build -DCMAKE_CXX_STANDARD=${{matrix.cxx_standard}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
run: cmake --build ${{github.workspace}}/build -j 4
linux:
strategy:
matrix:
compiler:
- { pkg: g++, exe: g++, version: 14 }
- { pkg: clang, exe: clang++, version: 18 }
cxx_standard: [ 20, 23 ]
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install Compiler
run: |
sudo apt update
sudo apt install -y ${{matrix.compiler.pkg}}-${{matrix.compiler.version}}
- name: Configure
env:
CXX: ${{matrix.compiler.exe}}-${{matrix.compiler.version}}
run: cmake -B ${{github.workspace}}/build -DCMAKE_CXX_STANDARD=${{matrix.cxx_standard}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DLIBHAT_TESTING=ON
- name: Build
run: cmake --build ${{github.workspace}}/build -j 4
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}} -R libhat_test_.*
windows:
strategy:
matrix:
target: [ Win32, x64, ARM, ARM64 ]
toolset: [ v143, ClangCL ]
cxx_standard: [ 20, 23 ]
include:
- target: Win32
vcvars: vcvars32
- target: x64
vcvars: vcvars64
- target: ARM
vcvars: vcvarsamd64_arm
- target: ARM64
vcvars: vcvarsamd64_arm64
exclude:
- toolset: ClangCL
target: ARM
- toolset: ClangCL
target: ARM64
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Configure
run: cmake -B ${{github.workspace}}/build -DCMAKE_CXX_STANDARD=${{matrix.cxx_standard}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DLIBHAT_SHARED_C_LIB=ON -DLIBHAT_TESTING=${{startsWith(matrix.target, 'ARM') && 'OFF' || 'ON'}} -A ${{matrix.target}} -T ${{matrix.toolset}}
- name: Build
run: cmake --build ${{github.workspace}}/build -j 4
- name: Test
if: ${{!startsWith(matrix.target, 'ARM')}}
working-directory: ${{github.workspace}}/build
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\${{matrix.vcvars}}.bat"
ctest -C ${{env.BUILD_TYPE}} -R libhat_test_.*