@@ -28,17 +28,16 @@ jobs:
28
28
uses : actions/checkout@v3
29
29
30
30
- name : Generate Test Matrix
31
- uses : alandefreitas/cpp-actions/cpp-matrix@v1.6 .2
31
+ uses : alandefreitas/cpp-actions/cpp-matrix@v1.8 .2
32
32
id : cpp-matrix
33
33
with :
34
34
compilers : |
35
35
gcc 13.1
36
- clang 16
36
+ clang 17
37
37
msvc 14.34
38
- standards : ' >=20'
39
- max-standards : 1
40
- latest-factors : gcc
41
- factors : clang # Don't include Asan because `clang/AST/Decl.h` fails
38
+ standards : ' 20'
39
+ latest-factors : ' '
40
+ factors : ' '
42
41
43
42
build :
44
43
needs : cpp-matrix
@@ -54,61 +53,76 @@ jobs:
54
53
55
54
name : ${{ matrix.name }}
56
55
runs-on : ${{ matrix.runs-on }}
57
- container : ${{ matrix.container }}
56
+ container : ${{ (matrix.compiler == 'gcc' && 'ubuntu:22.04') || matrix.container }}
57
+ env : ${{ matrix.env }}
58
58
permissions :
59
59
contents : write
60
60
61
61
steps :
62
+ - name : Install git
63
+ if : ${{ matrix.container }}
64
+ uses :
alandefreitas/cpp-actions/[email protected]
65
+ with :
66
+ apt-get : git
67
+
62
68
- name : Clone MrDocs
63
69
uses : actions/checkout@v3
64
70
71
+ - name : Setup C++
72
+ uses :
alandefreitas/cpp-actions/[email protected]
73
+ id : setup-cpp
74
+ with :
75
+ compiler : ${{ matrix.compiler }}
76
+ version : ${{ matrix.version }}
77
+ check-latest : ${{ matrix.compiler == 'clang' }}
78
+
79
+ - name : Install packages
80
+ uses :
alandefreitas/cpp-actions/[email protected]
81
+ id : package-install
82
+ with :
83
+ apt-get : ${{ matrix.install }} openjdk-11-jdk ninja-build pkg-config libncurses-dev
84
+ vcpkg : fmt duktape libxml2[tools]
85
+ cc : ${{ steps.setup-cpp.outputs.cc || matrix.cc }}
86
+ ccflags : ${{ matrix.ccflags }}
87
+ cxx : ${{ steps.setup-cpp.outputs.cxx || matrix.cxx }}
88
+ cxxflags : ${{ matrix.cxxflags }}
89
+
65
90
- name : Install LLVM
66
91
id : llvm-install
67
92
shell : bash
68
93
run : |
69
94
set -xe
70
-
71
- # Determine LLVM configuration type
72
- llvm_config_type="${{ matrix.build-type }}"
73
- if [ "${{ runner.os }}" == "Windows" ]; then
74
- llvm_runner_os="Windows"
75
- # if [ "$llvm_config_type" == "Release" ]; then
76
- # llvm_config_type="RelWithDebInfo"
77
- # fi
78
- llvm_archive_type="7z"
79
- llvm_config_type="Release"
95
+ config_type="Release"
96
+ filename="${{ runner.os }}-$config_type-29b20829.${{ ( runner.os == 'Windows' && '7z' ) || 'tar.xz' }}"
97
+ url="https://mrdox.com/llvm+clang/$filename"
98
+
99
+ # Download
100
+ if command -v curl &> /dev/null
101
+ then
102
+ curl -L -o "$filename" "$url"
103
+ elif command -v wget &> /dev/null
104
+ then
105
+ wget -O "$filename" "$url"
80
106
else
81
- llvm_runner_os="Linux"
82
- llvm_archive_type="tar.xz"
83
- llvm_config_type="Release"
84
- fi
85
- llvm_commit_id=29b20829
86
- llvm_archive_filename="$llvm_runner_os-$llvm_config_type-$llvm_commit_id.$llvm_archive_type"
87
- llvm_url="https://github.com/cppalliance/mrdocs/releases/download/llvm-package-release/$llvm_archive_filename"
88
-
89
- if ! curl --head --silent --fail "$llvm_url"; then
90
- llvm_url="https://mrdox.com/llvm+clang/$llvm_archive_filename"
107
+ echo "Neither curl nor wget are available"
108
+ exit 1
91
109
fi
92
-
93
- # Download LLVM binaries
94
- curl -L -o "$llvm_archive_filename" "$llvm_url"
95
-
96
- # Install LLVM to runner.tool_cache/llvm+clang
110
+
111
+ # Extract
97
112
llvm_root="${{runner.tool_cache}}/llvm+clang"
98
113
llvm_root=$(echo "$llvm_root" | sed 's/\\/\//g')
99
114
mkdir -p "$llvm_root"
100
-
101
115
if [ "${{ runner.os }}" != "Windows" ]; then
102
- tar -xvf "$llvm_archive_filename " -C "$llvm_root" --strip-components=1
116
+ tar -xvf "$filename " -C "$llvm_root" --strip-components=1
103
117
else
104
- 7z x "$llvm_archive_filename "
105
- cd "$llvm_config_type "
118
+ 7z x "$filename "
119
+ cd "$config_type "
106
120
mv * "$llvm_root"
107
121
cd ..
108
- rm -rf "$llvm_config_type "
122
+ rm -rf "$config_type "
109
123
fi
110
124
111
- # Export LLVM_ROOT
125
+ # Export
112
126
echo "llvm_root=$llvm_root"
113
127
echo -E "llvm-root=$llvm_root" >> $GITHUB_OUTPUT
114
128
@@ -117,37 +131,18 @@ jobs:
117
131
with :
118
132
node-version : ' 18'
119
133
120
- - name : Setup C++
121
- uses :
alandefreitas/cpp-actions/[email protected]
122
- id : setup-cpp
123
- with :
124
- compiler : ${{ matrix.compiler }}
125
- version : ${{ matrix.version }}
126
- check-latest : ${{ matrix.compiler == 'clang' }}
127
-
128
- - name : Install packages
129
- uses :
alandefreitas/cpp-actions/[email protected]
130
- id : package-install
131
- with :
132
- apt-get : ${{ matrix.install }} openjdk-11-jdk ninja-build ${{ matrix.compiler == 'clang' && 'libstdc++-12-dev' || '' }}
133
- vcpkg : fmt duktape libxml2[tools]
134
- cc : ${{ steps.setup-cpp.outputs.cc || matrix.cc }}
135
- ccflags : ${{ matrix.ccflags }}
136
- cxx : ${{ steps.setup-cpp.outputs.cxx || matrix.cxx }}
137
- cxxflags : ${{ matrix.cxxflags }}
138
-
139
134
- name : CMake Workflow
140
- uses : alandefreitas/cpp-actions/cmake-workflow@v1.6 .2
135
+ uses : alandefreitas/cpp-actions/cmake-workflow@v1.8 .2
141
136
with :
142
137
cmake-version : ' >=3.20'
143
- generator : Ninja
144
- toolchain : ${{ steps.package-install.outputs.vcpkg-toolchain }}
145
- build-type : ${{ matrix.build-type }}
146
138
cxxstd : ${{ matrix.cxxstd }}
147
139
cc : ${{ steps.setup-cpp.outputs.cc || matrix.cc }}
148
140
ccflags : ${{ matrix.ccflags }}
149
141
cxx : ${{ steps.setup-cpp.outputs.cxx || matrix.cxx }}
150
142
cxxflags : ${{ matrix.cxxflags }}${{ ( matrix.compiler == 'gcc' && ' -static-libstdc++') || '' }}${{ ( matrix.asan && ' -static-libasan') || '' }}${{ ( matrix.tsan && ' -static-libtsan') || '' }}
143
+ generator : Ninja
144
+ toolchain : ${{ steps.package-install.outputs.vcpkg_toolchain || steps.package-install.outputs.vcpkg-toolchain }}
145
+ build-type : ${{ matrix.build-type }}
151
146
install-prefix : .local
152
147
extra-args : |
153
148
-D LLVM_ROOT="${{ steps.llvm-install.outputs.llvm-root || '/usr/local' }}"
@@ -157,6 +152,8 @@ jobs:
157
152
install : true
158
153
package : ${{ matrix.is-main }}
159
154
package-dir : packages
155
+ package-generators : ${{ (runner.os == 'Windows' && '7Z ZIP WIX') || 'TGZ TXZ' }}
156
+ package-artifact : false
160
157
161
158
- name : Upload GitHub Release Artifacts
162
159
if : ${{ matrix.is-main && matrix.compiler != 'clang' }}
@@ -167,36 +164,20 @@ jobs:
167
164
retention-days : 1
168
165
169
166
- name : FlameGraph
170
- uses : alandefreitas/cpp-actions/flamegraph@v1.6 .2
167
+ uses : alandefreitas/cpp-actions/flamegraph@v1.8 .2
171
168
if : matrix.time-trace
172
169
with :
173
170
build-dir : build
174
171
github_token : ${{ secrets.GITHUB_TOKEN }}
175
172
176
173
- name : Codecov
177
- if : ${{ matrix.coverage }}
178
- run : |
179
- set -x
180
- # Find gcov
181
- gcov_tool="gcov"
182
- if command -v "gcov-${{ steps.setup-cpp.outputs.version-major }}.${{ steps.setup-cpp.outputs.version-minor }}" &> /dev/null; then
183
- gcov_tool="gcov"
184
- elif command -v "gcov-${{ steps.setup-cpp.outputs.version-major }}" &> /dev/null; then
185
- gcov_tool="gcov-${{ steps.setup-cpp.outputs.version-major }}"
186
- fi
187
- lcov -c -q -o "./build/coverage.info" -d "./build" --include "$(pwd)/*" --gcov-tool "$gcov_tool"
188
-
189
- # Upload to codecov
190
- bash <(curl -s https://codecov.io/bash) -f "./build/coverage.info"
191
-
192
- # Update summary
193
- echo "# Coverage" >> $GITHUB_STEP_SUMMARY
194
- echo "" >> $GITHUB_STEP_SUMMARY
195
- echo "[](https://codecov.io/github/$GITHUB_REPOSITORY/commit/$GITHUB_SHA)" >> $GITHUB_STEP_SUMMARY
196
- echo "" >> $GITHUB_STEP_SUMMARY
197
- echo "" >> $GITHUB_STEP_SUMMARY
198
- echo "$GITHUB_REF_NAME: [](https://codecov.io/github/$GITHUB_REPOSITORY/commit/$GITHUB_SHA)" >> $GITHUB_STEP_SUMMARY
199
- echo "" >> $GITHUB_STEP_SUMMARY
174
+ if : ${{ matrix.coverage}}
175
+
176
+ with :
177
+ directory : ' ./build'
178
+ fail_ci_if_error : true
179
+ gcov : true
180
+ verbose : true
200
181
201
182
docs :
202
183
needs : build
@@ -268,6 +249,8 @@ jobs:
268
249
name : Demos
269
250
timeout-minutes : 120
270
251
runs-on : ubuntu-22.04
252
+ container : ubuntu:23.04
253
+
271
254
permissions :
272
255
contents : write
273
256
@@ -285,29 +268,29 @@ jobs:
285
268
working-directory : packages
286
269
287
270
- name : Setup C++
288
- uses : alandefreitas/cpp-actions/setup-cpp@v1.6 .2
271
+ uses : alandefreitas/cpp-actions/setup-cpp@v1.8 .2
289
272
id : setup-cpp
290
273
with :
291
274
compiler : clang
292
275
version : 16
293
276
check-latest : true
294
277
295
278
- name : Install packages
296
- uses : alandefreitas/cpp-actions/package-install@v1.6 .2
279
+ uses : alandefreitas/cpp-actions/package-install@v1.8 .2
297
280
id : package-install
298
281
with :
299
- apt-get : libstdc++-12-dev asciidoctor
282
+ apt-get : libstdc++-12-dev asciidoctor cmake bzip2
300
283
cc : ${{ steps.setup-cpp.outputs.cc }}
301
284
cxx : ${{ steps.setup-cpp.outputs.cxx }}
302
285
303
286
- name : Install mrdocs from release package
304
287
run : |
305
288
set -x
306
- sudo find packages -name 'MrDocs-*-Linux.tar.gz' -exec tar -vxzf {} -C /usr/local --strip-components=1 \;
289
+ find packages -name 'MrDocs-*-Linux.tar.gz' -exec tar -vxzf {} -C /usr/local --strip-components=1 \;
307
290
mrdocs --version
308
291
309
292
- name : Clone Boost.URL
310
- uses : alandefreitas/cpp-actions/boost-clone@v1.6 .2
293
+ uses : alandefreitas/cpp-actions/boost-clone@v1.8 .2
311
294
id : boost-url-clone
312
295
with :
313
296
branch : master
@@ -404,21 +387,13 @@ jobs:
404
387
working-directory : build
405
388
406
389
- name : Create changelog
407
- uses : alandefreitas/cpp-actions/create-changelog@v1.6 .2
390
+ uses : alandefreitas/cpp-actions/create-changelog@v1.8 .2
408
391
with :
409
392
output-path : CHANGELOG.md
410
393
thank-non-regular : ${{ startsWith(github.ref, 'refs/tags/') }}
411
394
github-token : ${{ secrets.GITHUB_TOKEN }}
412
395
limit : 150
413
396
414
- - name : Remove branch release
415
- if : ${{ github.event_name == 'push' && (contains(fromJSON('["master", "develop"]'), github.ref_name)) }}
416
- uses :
dev-drprasad/[email protected]
417
- with :
418
- tag_name : ${{ github.ref_name }}-release
419
- github_token : ${{ secrets.GITHUB_TOKEN }}
420
- delete_release : true
421
-
422
397
- name : Create GitHub Package Release
423
398
if : ${{ github.event_name == 'push' && (contains(fromJSON('["master", "develop"]'), github.ref_name) || startsWith(github.ref, 'refs/tags/')) }}
424
399
uses : softprops/action-gh-release@v1
@@ -435,7 +410,7 @@ jobs:
435
410
if : ${{ github.event_name == 'push' && contains(fromJSON('["master", "develop"]'), github.ref_name) }}
436
411
with :
437
412
keep_latest : 1
438
- delete_tag_pattern : ${{ github.ref_name }}
413
+ delete_tag_pattern : ${{ github.ref_name || github.ref }}${{ ((!startsWith(github.ref, 'refs/tags/')) && '-release') || '' }}
439
414
env :
440
415
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
441
416
0 commit comments