-
Notifications
You must be signed in to change notification settings - Fork 567
132 lines (109 loc) · 4.56 KB
/
Copy pathubuntu.yml
File metadata and controls
132 lines (109 loc) · 4.56 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
name: ubuntu
on: [push, pull_request]
permissions: read-all
jobs:
ubuntu:
strategy:
fail-fast: false
matrix:
compiler:
- { cc: "gcc-11", cxx: "g++-11", os: "ubuntu-22.04" }
- { cc: "gcc-12", cxx: "g++-12", os: "ubuntu-22.04" }
- { cc: "gcc-13", cxx: "g++-13", os: "ubuntu-24.04" }
- { cc: "gcc-14", cxx: "g++-14", os: "ubuntu-24.04" }
- { cc: "gcc-15", cxx: "g++-15", os: "ubuntu-24.04" }
- { cc: "gcc-16", cxx: "g++-16", os: "ubuntu-26.04" }
- { cc: "clang-13", cxx: "clang++-13", os: "ubuntu-22.04" }
- { cc: "clang-14", cxx: "clang++-14", os: "ubuntu-22.04" }
- { cc: "clang-15", cxx: "clang++-15", os: "ubuntu-22.04" }
- { cc: "clang-16", cxx: "clang++-16", os: "ubuntu-22.04" }
- { cc: "clang-17", cxx: "clang++-17", os: "ubuntu-24.04" }
- { cc: "clang-18", cxx: "clang++-18", os: "ubuntu-24.04" }
- { cc: "clang-19", cxx: "clang++-19", os: "ubuntu-24.04" }
- { cc: "clang-20", cxx: "clang++-20", os: "ubuntu-24.04" }
- { cc: "clang-21", cxx: "clang++-21", os: "ubuntu-24.04" }
- { cc: "clang-22", cxx: "clang++-22", os: "ubuntu-24.04" }
name: "${{ matrix.compiler.cc }}"
runs-on: ${{ matrix.compiler.os }}
env:
CC: ${{ matrix.compiler.cc }}
CXX: ${{ matrix.compiler.cxx }}
steps:
- uses: actions/checkout@v7
- name: Configure clang
if: ${{ startsWith(matrix.compiler.cc, 'clang') }}
run: |
wget -qO - https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor | sudo tee /etc/apt/keyrings/llvm-archive-keyring.gpg > /dev/null
clang_version="${{ matrix.compiler.cc }}"
clang_version="${clang_version#clang-}"
ubuntu_codename="$(lsb_release -cs)"
llvm_repository="http://apt.llvm.org/${ubuntu_codename}/"
llvm_suite="llvm-toolchain-${ubuntu_codename}-${clang_version}"
echo "deb [signed-by=/etc/apt/keyrings/llvm-archive-keyring.gpg] ${llvm_repository} ${llvm_suite} main" \
| sudo tee /etc/apt/sources.list.d/llvm.list
sudo apt update
sudo apt install -y ${{ matrix.compiler.cc }}
- name: Configure gcc
if: ${{ startsWith(matrix.compiler.cc, 'gcc') }}
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt update
sudo apt install -y ${{ matrix.compiler.cxx }}
- name: Test Unicode identifiers
if: ${{ matrix.compiler.cc == 'gcc-16' }}
run: |
"${CXX}" -std=c++17 -Wall -Wextra -Wshadow -pedantic-errors -Werror -Iinclude test/test_nonascii.cpp -o test_nonascii
./test_nonascii
"${CXX}" -std=c++26 -freflection -Wall -Wextra -Wshadow -pedantic-errors -Werror -Iinclude test/test_nonascii.cpp -o test_nonascii_reflection
./test_nonascii_reflection
- name: Configure Release
run: |
standard_options=()
if [[ "${{ matrix.compiler.cc }}" == "gcc-16" ]]; then
standard_options=(-DCMAKE_CXX_STANDARD=26 -DCMAKE_CXX_STANDARD_REQUIRED=ON)
fi
cmake -S . -B build-release \
-DCMAKE_BUILD_TYPE=Release \
"${standard_options[@]}"
- name: Build Release
run: cmake --build build-release --parallel --config Release
- name: Test Release
run: ctest --test-dir build-release --output-on-failure --no-tests=error -C Release
- name: Configure Debug
run: |
standard_options=()
if [[ "${{ matrix.compiler.cc }}" == "gcc-16" ]]; then
standard_options=(-DCMAKE_CXX_STANDARD=26 -DCMAKE_CXX_STANDARD_REQUIRED=ON)
fi
cmake -S . -B build-debug \
-DCMAKE_BUILD_TYPE=Debug \
"${standard_options[@]}"
- name: Build Debug
run: cmake --build build-debug --parallel --config Debug
- name: Test Debug
run: ctest --test-dir build-debug --output-on-failure --no-tests=error -C Debug
bazel:
name: Bazel
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
- name: Test
working-directory: test
run: bazelisk test //... --config=ci
meson:
name: Meson
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
- name: Install Meson
run: |
sudo apt update
sudo apt install -y meson ninja-build
- name: Configure
run: meson setup build-meson
- name: Test
run: meson test -C build-meson --print-errorlogs
- name: Configure with hash
run: meson setup build-meson-hash -Dhash=true
- name: Test with hash
run: meson test -C build-meson-hash --print-errorlogs