-
Notifications
You must be signed in to change notification settings - Fork 0
148 lines (118 loc) · 3.69 KB
/
ci.yml
File metadata and controls
148 lines (118 loc) · 3.69 KB
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
jobs:
build-linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
compiler: [gcc, clang]
build_type: [Release, Debug]
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libcairo2-dev \
libjpeg-dev \
zlib1g-dev \
libzstd-dev
- name: Set up compiler
run: |
if [ "${{ matrix.compiler }}" = "clang" ]; then
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
else
echo "CC=gcc" >> $GITHUB_ENV
echo "CXX=g++" >> $GITHUB_ENV
fi
- name: Configure CMake
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DENABLE_NATIVE_ARCH=OFF \
-DENABLE_SANITIZERS=${{ matrix.build_type == 'Debug' && 'ON' || 'OFF' }}
- name: Build
run: cmake --build build -j$(nproc)
- name: Run tests
run: ctest --test-dir build --output-on-failure -j$(nproc)
build-macos:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
build_type: [Release, Debug]
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
brew install cairo jpeg zstd
- name: Configure CMake
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DENABLE_NATIVE_ARCH=OFF
- name: Build
run: cmake --build build -j$(sysctl -n hw.ncpu)
- name: Run tests
run: ctest --test-dir build --output-on-failure -j$(sysctl -n hw.ncpu)
build-windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
build_type: [Release, Debug]
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
vcpkg install cairo libjpeg-turbo zstd zlib --triplet x64-windows
- name: Configure CMake
run: |
cmake -B build `
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} `
-DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" `
-DENABLE_NATIVE_ARCH=OFF
- name: Build
run: cmake --build build --config ${{ matrix.build_type }} -j $env:NUMBER_OF_PROCESSORS
- name: Run tests
run: ctest --test-dir build --output-on-failure -C ${{ matrix.build_type }}
build-macos-arm64:
runs-on: macos-14 # M1 runner
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: brew install cairo jpeg zstd
- name: Configure CMake
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_NATIVE_ARCH=OFF
- name: Build
run: cmake --build build -j$(sysctl -n hw.ncpu)
- name: Run tests
run: ctest --test-dir build --output-on-failure
# Minimal build without optional dependencies
build-minimal:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install minimal dependencies
run: |
sudo apt-get update
sudo apt-get install -y zlib1g-dev libzstd-dev
- name: Configure CMake (minimal)
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_NATIVE_ARCH=OFF \
-DWITH_CAIRO=OFF
- name: Build
run: cmake --build build -j$(nproc)
- name: Run tests
run: ctest --test-dir build --output-on-failure -j$(nproc)