-
Notifications
You must be signed in to change notification settings - Fork 9
186 lines (166 loc) · 5.13 KB
/
ci.yml
File metadata and controls
186 lines (166 loc) · 5.13 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
name: CI
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths-ignore:
- '**.md'
- 'docs/**'
- .github/**
- '!.github/workflows/ci.yml'
push:
branches:
- main
paths-ignore:
- '**.md'
- 'docs/**'
- .github/**
- '!.github/workflows/ci.yml'
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
# Ubuntu with GCC
- os: ubuntu-22.04
cxx: g++-12
cmake_gen: Ninja
cmake_flags: ""
# Ubuntu with Clang
- os: ubuntu-22.04
cxx: clang++-15
cmake_gen: Ninja
cmake_flags: ""
# Ubuntu ARM
- os: ubuntu-22.04-arm
cxx: g++-12
cmake_gen: Ninja
cmake_flags: ""
# Ubuntu with ASAN (GCC)
- os: ubuntu-22.04
cxx: g++-12
cmake_gen: Ninja
cmake_flags: "-DMERVE_SANITIZE=ON"
name_suffix: " (ASAN)"
# Ubuntu with ASAN (Clang)
- os: ubuntu-22.04
cxx: clang++-15
cmake_gen: Ninja
cmake_flags: "-DMERVE_SANITIZE=ON"
name_suffix: " (ASAN)"
# macOS 14
- os: macos-14
cxx: clang++
cmake_gen: Ninja
cmake_flags: ""
# macOS 15
- os: macos-15
cxx: clang++
cmake_gen: Ninja
cmake_flags: ""
# macOS with ASAN
- os: macos-15
cxx: clang++
cmake_gen: Ninja
cmake_flags: "-DMERVE_SANITIZE=ON"
name_suffix: " (ASAN)"
# Windows
- os: windows-latest
cmake_gen: Visual Studio 17 2022
cmake_arch: x64
cmake_config: Release
cmake_flags: ""
# Ubuntu with simdutf
- os: ubuntu-latest
cxx: g++-13
cmake_gen: Ninja
cmake_flags: "-DMERVE_USE_SIMDUTF=ON"
name_suffix: " (simdutf)"
# Ubuntu with UBSAN (GCC)
- os: ubuntu-22.04
cxx: g++-12
cmake_gen: Ninja
cmake_flags: "-DMERVE_SANITIZE_UNDEFINED=ON"
name_suffix: " (UBSAN)"
# Ubuntu with UBSAN (Clang)
- os: ubuntu-22.04
cxx: clang++-15
cmake_gen: Ninja
cmake_flags: "-DMERVE_SANITIZE_UNDEFINED=ON"
name_suffix: " (UBSAN)"
# Ubuntu with simdutf + ASAN
- os: ubuntu-latest
cxx: g++-13
cmake_gen: Ninja
cmake_flags: "-DMERVE_USE_SIMDUTF=ON -DMERVE_SANITIZE=ON"
name_suffix: " (simdutf, ASAN)"
name: ${{ matrix.os }} ${{ matrix.cxx || 'MSVC' }}${{ matrix.name_suffix || '' }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6.0.2
- name: Setup Ninja (Ubuntu)
if: startsWith(matrix.os, 'ubuntu')
run: sudo apt-get install ninja-build
- name: Setup Ninja (macOS)
if: startsWith(matrix.os, 'macos')
run: brew install ninja
- name: Configure (Unix)
if: matrix.os != 'windows-latest'
run: cmake -DMERVE_TESTING=ON ${{ matrix.cmake_flags }} -G "${{ matrix.cmake_gen }}" -B build
env:
CXX: ${{ matrix.cxx }}
- name: Configure (Windows)
if: matrix.os == 'windows-latest'
run: cmake -DMERVE_TESTING=ON ${{ matrix.cmake_flags }} -G "${{ matrix.cmake_gen }}" -A ${{ matrix.cmake_arch }} -B build
- name: Build (Unix)
if: matrix.os != 'windows-latest'
run: cmake --build build -j4
- name: Build (Windows)
if: matrix.os == 'windows-latest'
run: cmake --build build --config ${{ matrix.cmake_config }}
- name: Test (Unix)
if: matrix.os != 'windows-latest'
run: ctest --output-on-failure --test-dir build
- name: Test (Windows)
if: matrix.os == 'windows-latest'
run: ctest -C ${{ matrix.cmake_config }} --output-on-failure --test-dir build
rust:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
toolchain: stable
- os: ubuntu-22.04
toolchain: nightly
- os: ubuntu-22.04-arm
toolchain: stable
- os: macos-14
toolchain: stable
- os: macos-15
toolchain: stable
- os: windows-latest
toolchain: stable
name: Rust ${{ matrix.toolchain }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6.0.2
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
components: clippy
- name: Clippy
working-directory: rust
run: cargo clippy -- -D warnings
- name: Test
working-directory: rust
run: cargo test
- name: Test (no default features)
working-directory: rust
run: cargo test --no-default-features