-
Notifications
You must be signed in to change notification settings - Fork 67
132 lines (104 loc) · 3.47 KB
/
main.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
132
name: CI
on:
push:
pull_request:
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
build-autoconf:
name: linux-autoconf
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup
run: sudo apt-get install build-essential libtool-bin
- name: Autogen
run: ./autogen.sh
- name: Configure
run: ./configure
- name: Make
run: make
- name: Check
run: make check
- name: Distribution check
run: make distcheck
build-cmake:
name: ${{ matrix.toolchain }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
toolchain:
- linux-gcc
- macos-clang
- windows-msvc-shared
- windows-msvc-static
configuration:
- Release
include:
- toolchain: linux-gcc
os: ubuntu-latest
compiler: gcc
- toolchain: macos-clang
os: macos-latest
compiler: clang
- toolchain: windows-msvc-shared
os: windows-latest
compiler: msvc
- toolchain: windows-msvc-static
os: windows-latest
compiler: msvc
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Configure (${{ matrix.configuration }})
run: |
if [ "${{ matrix.toolchain }}" == "windows-msvc-shared" ]; then
cmake -S . -Bbuild -DCMAKE_UNITY_BUILD=ON -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=ON
elif [ "${{ matrix.toolchain }}" == "windows-msvc-static" ]; then
cmake -S . -Bbuild -DCMAKE_UNITY_BUILD=ON -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -DBUILD_TESTING=ON -DBASH_EXECUTABLE="C:/Program Files/Git/bin/bash.exe" -DBUILD_SHARED_LIBS=OFF
else
cmake -S . -Bbuild -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} -DCMAKE_UNITY_BUILD=ON -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -DBUILD_TESTING=ON
fi
- name: Build with ${{ matrix.compiler }}
run: |
if [ "${{ matrix.compiler }}" == "msvc" ]; then
cmake --build build --config ${{ matrix.configuration }}
else
cmake --build build
fi
- name: Test
run: ctest --test-dir build --build-config ${{ matrix.configuration }} --verbose
build-cmake-cygwin:
name: windows-cygwin
runs-on: windows-latest
steps:
- name: Set git to use LF
run: git config --global core.autocrlf input
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup cygwin
uses: cygwin/cygwin-install-action@master
with:
packages: >-
cmake
gcc-g++
make
ninja
- name: Configure (Release)
run: |
export PATH=/usr/bin:$PATH
cmake -S . -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_UNITY_BUILD=ON -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -DBUILD_TESTING=ON -G Ninja
shell: C:\cygwin\bin\bash.exe -eo pipefail -o igncr '{0}'
- name: Build with gcc
run: |
export PATH=/usr/bin:$PATH
cmake --build build --target install
shell: C:\cygwin\bin\bash.exe -eo pipefail -o igncr '{0}'
- name: Test
run: |
export PATH=/usr/bin:/usr/local/bin:$PATH
ctest --test-dir build --build-config Release --verbose
shell: C:\cygwin\bin\bash.exe -eo pipefail -o igncr '{0}'