Repository navigation
86 lines (72 loc) · 2.42 KB
/
Copy pathci.yml
File metadata and controls
86 lines (72 loc) · 2.42 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
name: CI
on:
push:
branches: [master]
pull_request:
workflow_dispatch:
jobs:
build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: GCC 14 · Linux
os: ubuntu-24.04
cc: gcc-14
cxx: g++-14
- name: Clang 19 · Linux
os: ubuntu-24.04
cc: clang-19
cxx: clang++-19
- name: AppleClang · macOS ARM64
os: macos-15
steps:
- uses: actions/checkout@v4
- name: Install compiler (Linux)
if: runner.os == 'Linux'
run: |
if [[ "${{ matrix.cc }}" == clang-* ]]; then
# The runner image ships Clang 18; the library needs 19+.
wget -qO- https://apt.llvm.org/llvm.sh | sudo bash -s -- 19
else
sudo apt-get update -q
sudo apt-get install -y ${{ matrix.cc }} ${{ matrix.cxx }}
fi
- name: Configure
run: >
cmake -B build -DCMAKE_BUILD_TYPE=Release
${{ runner.os == 'Linux' && format('-DCMAKE_C_COMPILER={0} -DCMAKE_CXX_COMPILER={1}', matrix.cc, matrix.cxx) || '' }}
- name: Build
run: cmake --build build --config Release -j 4
- name: Test
run: ctest --test-dir build --output-on-failure
singleheader:
name: Single-header amalgamation
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install compiler
run: |
sudo apt-get update -q
sudo apt-get install -y g++-14
# The release attaches the checked-in header, so it must never be stale.
- name: singleheader/useful_abstractions.h is up to date
run: python3 singleheader/amalgamate.py --check
# The README's usage examples are copies of examples/*.cpp, which ctest
# builds and runs; the copy must be exact.
- name: README examples match the tested programs
run: python3 tools/sync_readme_examples.py --check
- name: It compiles against nothing but the standard library
env:
CXX: g++-14
run: python3 tools/test_packaging.py --only dropin
- name: It still works as a CMake dependency
env:
CC: gcc-14
CXX: g++-14
run: python3 tools/test_packaging.py --only fetchcontent find_package