-
Notifications
You must be signed in to change notification settings - Fork 3
80 lines (76 loc) · 2.46 KB
/
build.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
name : Build
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
check_clang_format:
name: "Check C++ style"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install clang
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 17
sudo apt-get install clang-format-17
- name: "Clang-format"
run: clang-format-17 --Werror --dry-run test-boxed-cpp.cpp include/boxed-cpp/boxed.hpp
editorconfig:
name: "Check editorconfig"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: editorconfig-checker/action-editorconfig-checker@main
- run: editorconfig-checker
ubuntu:
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, ubuntu-22.04, ubuntu-20.04]
cxx: [20]
build_type: ["RelWithDebInfo"]
llvm_version:
[
"17",
"18"
]
name: " ${{ matrix.os }} (clang-${{ matrix.llvm_version }}, C++${{ matrix.cxx }}, ${{matrix.build_type}})"
runs-on: ${{ matrix.os }}
outputs:
id: "${{ matrix.compiler }} (C++${{ matrix.cxx }}, ${{ matrix.build_type }})"
steps:
- uses: actions/checkout@v3
# - name: ccache
# uses: hendrikmuhs/[email protected]
# with:
# key: "ccache-ubuntu2204-${{ matrix.compiler }}-${{ matrix.cxx }}-${{ matrix.build_type }}"
# max-size: 256M
- name: "update APT database"
run: sudo apt -q update
- name: Install clang
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh ${{ matrix.llvm_version }}
# can not use clang-tidy until https://github.com/actions/runner-images/issues/8659 get fixed
- name: "Download dependencies"
run: sudo apt install cmake ninja-build # catch2
- name: "Cmake configure"
run: |
cmake -S . -B build -G Ninja \
-DBOXED_TESTING=ON \
-DENABLE_TIDY=OFF \
-DPEDANTIC_COMPILER=OFF \
-DCMAKE_CXX_FLAGS="-Wno-unknown-warning-option" \
-DCMAKE_CXX_STANDARD=${{ matrix.cxx }} \
-DCMAKE_CXX_COMPILER=clang++-${{ matrix.llvm_version }} \
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
- name: "build"
run: cmake --build build --parallel 3
- name: "run test"
run: ./build/test-boxed-cpp