-
Notifications
You must be signed in to change notification settings - Fork 2.5k
102 lines (87 loc) · 2.83 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
91
92
93
94
95
96
97
98
99
100
101
102
name: CMake
on: [push, pull_request]
jobs:
ci-cmake:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: Ubuntu GCC
os: ubuntu-latest
compiler: gcc
cflags: -Wall -Wextra
pkgtgt: package package_source
- name: Ubuntu GCC -O3
os: ubuntu-latest
compiler: gcc
cflags: -O3 -Wall -Wextra
pkgtgt: package package_source
- name: Ubuntu Clang
os: ubuntu-latest
compiler: clang
cflags: -Wall -Wextra
pkgtgt: package package_source
- name: Ubuntu Clang Debug
os: ubuntu-latest
compiler: clang
cflags: -Wall -Wextra
build-config: Debug
pkgtgt: package package_source
- name: Windows MSVC Win32
os: windows-latest
compiler: cl
cflags: /W3
cmake-args: -A Win32
pkgtgt: PACKAGE
- name: Windows MSVC Win64
os: windows-latest
compiler: cl
cflags: /W3
cmake-args: -A x64
pkgtgt: PACKAGE
- name: Windows GCC
os: windows-latest
compiler: gcc
cflags: -Wall -Wextra
cmake-args: -G Ninja
pkgtgt: package
- name: macOS Clang
os: macos-latest
compiler: clang
cflags: -Wall -Wextra
pkgtgt: package
- name: macOS GCC
os: macos-latest
compiler: gcc-12
cflags: -Wall -Wextra
pkgtgt: package
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install packages (Windows)
if: runner.os == 'Windows'
run: |
choco install --no-progress ninja ${{ matrix.packages }}
- name: Generate project files
run: cmake -S . -B ../build ${{ matrix.cmake-args }} -D CMAKE_BUILD_TYPE=${{ matrix.build-config || 'Release' }} -DZLIB_BUILD_MINIZIP=ON -DMINIZIP_ENABLE_BZIP2=OFF
env:
CC: ${{ matrix.compiler }}
CFLAGS: ${{ matrix.cflags }}
- name: Compile source code
run: cmake --build ../build --config ${{ matrix.build-config || 'Release' }}
- name: Run test cases
run: ctest -C Release --output-on-failure --max-width 120
working-directory: ../build
- name: create packages
run: cmake --build ../build --config ${{ matrix.build-config || 'Release' }} -t ${{ matrix.pkgtgt }}
- name: Upload build errors
uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ matrix.name }} (cmake)
path: |
../build/CMakeFiles/CMakeOutput.log
../build/CMakeFiles/CMakeError.log
retention-days: 7