-
Notifications
You must be signed in to change notification settings - Fork 12
131 lines (125 loc) · 4.06 KB
/
ci-build.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: CI-Build
on:
push:
branches: [master]
pull_request:
jobs:
build-ubuntu:
runs-on: ${{ matrix.cfg.os }}
strategy:
matrix:
cfg:
- { os: ubuntu-20.04, compiler: gcc-7 }
- { os: ubuntu-20.04, compiler: gcc } # GCC 9
- { os: ubuntu-20.04, compiler: clang } # Clang 10
- { os: ubuntu-22.04, compiler: gcc } # GCC 11
- { os: ubuntu-22.04, compiler: clang } # Clang 14
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install Compiler
run: |
sudo apt update
if [[ "${{ matrix.cfg.compiler }}" =~ ^gcc.*$ ]]; then
gxx=$(echo "${{ matrix.cfg.compiler }}" | sed -e 's,gcc,g++,')
sudo apt install "$gxx"
else
sudo apt install "${{ matrix.cfg.compiler }}"
fi
- name: Build and Test
run: |
export CC="${{ matrix.cfg.compiler }}"
export CXX="$(echo "${{ matrix.cfg.compiler }}" | sed -e 's,gcc,g++,;s,clang,clang++,')"
mkdir -p build && cd build
cmake -DCMAKE_BUILD_TYPE=Debug -DST_BUILD_TESTS=ON ..
make test
build-macos:
runs-on: ${{ matrix.cfg.os }}
strategy:
matrix:
cfg:
- { os: macOS-11, xcode: Xcode_12.5.1 }
- { os: macOS-12, xcode: Xcode_13.4.1 }
- { os: macOS-12, xcode: Xcode_14.2 }
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Build and Test
run: |
export PATH="/Applications/${{ matrix.cfg.xcode }}.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:$PATH"
export CC=clang
export CXX=clang++
mkdir -p build && cd build
cmake -DCMAKE_BUILD_TYPE=Debug -DST_BUILD_TESTS=ON ..
make test
build-msvc:
runs-on: ${{ matrix.cfg.os }}
strategy:
matrix:
cfg:
- { os: windows-2019, msvc: Visual Studio 16 2019, arch: Win32 }
- { os: windows-2019, msvc: Visual Studio 16 2019, arch: x64 }
- { os: windows-2022, msvc: Visual Studio 17 2022, arch: Win32 }
- { os: windows-2022, msvc: Visual Studio 17 2022, arch: x64 }
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Build and Test
run: |
mkdir build
cd build
cmake -G "${{ matrix.cfg.msvc }}" -A ${{ matrix.cfg.arch }} -DST_BUILD_TESTS=ON ..
cmake --build . --config Debug --target test
build-mingw:
runs-on: windows-2019
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Build and Test
run: |
mkdir build
cd build
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Debug -DST_BUILD_TESTS=ON ..
mingw32-make test
build-msys2:
runs-on: windows-latest
strategy:
matrix:
cfg:
- { mingw: mingw32, arch: i686 }
- { mingw: mingw64, arch: x86_64 }
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install compiler and tools
run: |
$Env:Path = "C:\msys64\usr\bin;$Env:Path"
pacman -Sy --noconfirm mingw-w64-${{ matrix.cfg.arch }}-gcc `
mingw-w64-${{ matrix.cfg.arch }}-cmake `
mingw-w64-${{ matrix.cfg.arch }}-ninja
- name: Build and Test
run: |
mkdir build
cd build
$Env:Path = "C:\msys64\${{ matrix.cfg.mingw }}\bin;C:\msys64\usr\bin;$Env:Path"
cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DST_BUILD_TESTS=ON ..
ninja test
build-solaris:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Build and Test
uses: vmactions/solaris-vm@v0
with:
prepare: pkg install -q cmake gcc
run: |
mkdir -p build && cd build
cmake -DCMAKE_BUILD_TYPE=Debug -DST_BUILD_TESTS=ON ..
make test