-
Notifications
You must be signed in to change notification settings - Fork 6
66 lines (56 loc) · 1.95 KB
/
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: Unit Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
compiler: [ {cxx: clang++, c: clang}, {cxx: g++, c: gcc}, {cxx: cl, c: cl} ]
arch: [{msvc: 86, gcc: 32}, {msvc: 64, gcc: 64}]
exclude:
- os: windows-latest
compiler: {cxx: g++, c: gcc}
- os: ubuntu-latest
compiler: {cxx: cl, c: cl}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Configure env (linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y ninja-build gcc-multilib g++-multilib
- name: Configure env (windows)
uses: ilammy/msvc-dev-cmd@v1
if: runner.os == 'Windows'
with:
arch: x${{ matrix.arch.msvc }}
- name: Create build folders
run: |
mkdir build
cd build
mkdir out
- name: Generate build files (clang, gcc)
if: matrix.compiler.cxx == 'clang++' || matrix.compiler.cxx == 'g++'
run: |
cd build
cmake -DLIGHTNING_SCANNER_BUILD_TESTS=ON -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=out -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }} -DCMAKE_C_COMPILER=${{ matrix.compiler.c }} -DCMAKE_CXX_FLAGS=-m${{ matrix.arch.gcc }} -DCMAKE_C_FLAGS=-m${{ matrix.arch.gcc }} -G"Ninja" ..
- name: Generate build files (msvc)
if: matrix.compiler.cxx == 'cl'
run: |
cd build
cmake -DLIGHTNING_SCANNER_BUILD_TESTS=ON -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=out -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }} -DCMAKE_C_COMPILER=${{ matrix.compiler.c }} -G"Ninja" ..
- name: Build
run: |
cd build
ninja -j32
- name: Run tests
run: |
cd build/tests
ctest