-
-
Notifications
You must be signed in to change notification settings - Fork 79
189 lines (155 loc) · 4.89 KB
/
cpp.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
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
187
188
189
name: C++
on:
push:
branches: [main]
pull_request:
env:
CABIN_TERM_COLOR: always
permissions:
contents: read
jobs:
format:
runs-on: ubuntu-24.04
env:
CXX: g++-13
steps:
- uses: actions/checkout@v4
- name: Setup dependencies
uses: ./.github/actions/setup-ubuntu-deps
- name: Build Cabin
run: make RELEASE=1
- name: Install clang-format
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x ./llvm.sh
sudo ./llvm.sh 19
sudo apt-get install -y clang-format-19
- name: cabin fmt
run: ./build/cabin fmt --check --verbose
env:
CABIN_FMT: clang-format-19
lint:
runs-on: ubuntu-24.04
env:
CXX: g++-13
steps:
- uses: actions/checkout@v4
- name: Setup dependencies
uses: ./.github/actions/setup-ubuntu-deps
- name: Build Cabin
run: make RELEASE=1
- name: Install cpplint
run: sudo apt-get install -y cpplint
- name: cabin lint
run: ./build/cabin lint --verbose
build-and-test:
name: "build & test (${{ matrix.compiler.name }})"
runs-on: ${{ matrix.compiler.os }}
strategy:
fail-fast: false
matrix:
compiler:
- name: "Clang 16"
cxx: clang++-16
os: ubuntu-22.04
- name: "Clang 17"
cxx: clang++-17
os: ubuntu-24.04
- name: "Clang 18"
cxx: clang++-18
os: ubuntu-24.04
- name: "Clang 19"
cxx: clang++-19
os: ubuntu-24.04
- name: "GCC 12"
cxx: g++-12
os: ubuntu-24.04
- name: "GCC 13"
cxx: g++-13
os: ubuntu-24.04
- name: "GCC 14"
cxx: g++-14
os: ubuntu-24.04
- name: "Apple Clang - macOS 13"
cxx: c++
os: macos-13
- name: "Apple Clang - macOS 14"
cxx: c++
os: macos-14
- name: "Apple Clang - macOS 15"
cxx: c++
os: macos-15
env:
CXX: ${{ matrix.compiler.cxx }}
steps:
- uses: actions/checkout@v4
- name: Setup Clang
if: startsWith(matrix.compiler.cxx, 'clang')
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x ./llvm.sh
sudo ./llvm.sh "${CXX##*-}"
- name: Setup GCC
if: matrix.compiler.cxx == 'g++-14'
run: sudo apt update && sudo apt install -y gcc-14
- name: Setup Ubuntu dependencies
if: runner.os == 'Linux'
uses: ./.github/actions/setup-ubuntu-deps
- name: Setup macOS dependencies
if: runner.os == 'macOS'
uses: ./.github/actions/setup-macos-deps
- name: Print versions
run: make versions
- name: First Generation Build
run: make -j4
- name: Test the first generation
run: make test -j4
- name: Integration Test the first generation
run: |
wget https://raw.githubusercontent.com/felipec/sharness/refs/tags/v1.2.1/sharness.sh
wget https://raw.githubusercontent.com/felipec/sharness/refs/tags/v1.2.1/lib-sharness/functions.sh
mv sharness.sh tests/
mkdir tests/lib-sharness
mv functions.sh tests/lib-sharness/
prove -v -j4 --shuffle tests/[0-9]*.sh
- name: Second Generation Build
run: ./build/cabin build --verbose
- name: Test the second generation
run: ./cabin-out/debug/cabin test --verbose
- name: Third Generation Build & Test
run: ./cabin-out/debug/cabin --verbose run --release test --verbose
- name: Print Cabin version
run: ./cabin-out/debug/cabin version --verbose
- name: Create a new project with the third generation
run: ./cabin-out/debug/cabin new hello_world
- name: Run the new project
run: ../cabin-out/debug/cabin --verbose run
working-directory: hello_world
# - name: Print coverage
# if: success() && matrix.coverage == 'on'
# run: |
# lcov --directory . --capture --output-file coverage.info --gcov-tool "${CC_PATH/gcc/gcov}"
# lcov --remove coverage.info '/usr/*' "${HOME}"'/.cache/*' --output-file coverage.info
# lcov --list coverage.info
# env:
# CC_PATH: /usr/bin/${{ env.CC }}
clang-tidy:
runs-on: ubuntu-24.04
env:
CXX: g++-13
steps:
- uses: actions/checkout@v4
- name: Setup dependencies
uses: ./.github/actions/setup-ubuntu-deps
- name: Build Cabin
run: make RELEASE=1
- name: Install clang-tidy
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x ./llvm.sh
sudo ./llvm.sh 19
sudo apt-get install -y clang-tidy-19
- name: cabin tidy
run: ./build/cabin tidy --verbose
env:
CABIN_TIDY: clang-tidy-19