-
Notifications
You must be signed in to change notification settings - Fork 2
107 lines (101 loc) · 4.45 KB
/
unit.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
##======================================================================================================================
## Kyosu - Complex Without Complexes
## Copyright : KYOSU Contributors & Maintainers
## SPDX-License-Identifier: BSL-1.0
##======================================================================================================================
name: KYOSU Unit Testing
on:
pull_request:
branches:
- main
concurrency:
group: kyosu-unit-${{ github.ref }}
cancel-in-progress: true
jobs:
windows:
runs-on: [windows-2022]
strategy:
fail-fast: false
matrix:
cfg:
- { tool: "-T ClangCL", config: Debug }
- { tool: "-T ClangCL", config: Release }
# - { tool: , config: Debug }
# - { tool: , config: Release }
steps:
- name: Fetch current branch
uses: actions/checkout@v3
- name: Running CMake for MSVC
run: |
mkdir build && cd build
cmake -G "Visual Studio 17 2022" ${{ matrix.cfg.tool }} -A x64 ..
- name: Compiling Unit Tests
run: |
cd build
cmake --build . --target kyosu-test --config ${{ matrix.cfg.config }} --parallel 2
cmake --build . --target kyosu-test --config Release --parallel 2
- name: Running Tests
run: |
cd build
ctest -C ${{ matrix.cfg.config }} --output-on-failure
linux:
runs-on: [ubuntu-latest]
container:
image: ghcr.io/jfalcou/compilers:v6
strategy:
fail-fast: false
matrix:
cfg:
- { compiler: g++-12 , opts: -O0 , linker: }
- { compiler: clang++ , opts: -O0 , linker: }
- { compiler: clang++ , opts: "-O3 -flto -DNDEBUG" , linker: }
- { compiler: g++-12 , opts: "-O3 -flto -DNDEBUG" , linker: }
- { compiler: clang++ , opts: "-O3 -flto -DNDEBUG -stdlib=libc++" , linker: -stdlib=libc++ }
- { compiler: clang++ , opts: "-O0 -stdlib=libc++" , linker: -stdlib=libc++ }
steps:
- name: Fetch current branch
uses: actions/checkout@v3
- name: Running CMake for ${{ matrix.cfg.compiler }} with ${{ matrix.cfg.opts }}
run: |
mkdir build && cd build
cmake .. -G Ninja -DCMAKE_CXX_COMPILER=${{ matrix.cfg.compiler }} -DCMAKE_CXX_FLAGS="${{ matrix.cfg.opts }}" -DCMAKE_EXE_LINKER_FLAGS=${{ matrix.cfg.linker }}
- name: Running Unit Tests
run: cd build && ninja kyosu-test -j 2 && ctest --output-on-failure -j 2
macosx:
runs-on: [macos-12]
strategy:
fail-fast: false
matrix:
cfg:
- { compiler: g++-12 , opts: -O0 , linker: }
# - { compiler: g++-12 , opts: "-O3 -DNDEBUG" , linker: }
# - { compiler: clang++ , opts: -O0 , linker: }
# - { compiler: clang++ , opts: "-O3 -flto -DNDEBUG" , linker: }
# - { compiler: clang++ , opts: "-O3 -flto -DNDEBUG -stdlib=libc++" , linker: -stdlib=libc++ }
# - { compiler: clang++ , opts: "-O0 -stdlib=libc++" , linker: -stdlib=libc++ }
steps:
- name: Fetch current branch
uses: actions/checkout@v3
- name: Running CMake for ${{ matrix.cfg.compiler }} with ${{ matrix.cfg.opts }}
run: |
mkdir build && cd build
cmake .. -DCMAKE_CXX_COMPILER=${{ matrix.cfg.compiler }} -DCMAKE_CXX_FLAGS="${{ matrix.cfg.opts }}" -DCMAKE_EXE_LINKER_FLAGS=${{ matrix.cfg.linker }}
- name: Running Unit Tests
run: cd build && make kyosu-test -j 2 && ctest --output-on-failure -j 2
# android:
# runs-on: [macos-12]
# strategy:
# fail-fast: false
# matrix:
# cfg:
# - { opts: -O0 }
# - { opts: "-O3 -flto -DNDEBUG"}
# steps:
# - name: Fetch current branch
# uses: actions/checkout@v3
# - name: Running CMake for ${{ matrix.cfg.compiler }} with ${{ matrix.cfg.opts }}
# run: |
# mkdir build && cd build
# cmake .. -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a
# - name: Compiling Unit Tests
# run: cd build && make kyosu-test -j 2