Skip to content

Commit 61ede2b

Browse files
committed
ci: update cpp-actions to v1.8.2
1 parent 49414e4 commit 61ede2b

File tree

2 files changed

+76
-101
lines changed

2 files changed

+76
-101
lines changed

.github/workflows/ci.yml

+75-100
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,16 @@ jobs:
2828
uses: actions/checkout@v3
2929

3030
- name: Generate Test Matrix
31-
uses: alandefreitas/cpp-actions/cpp-matrix@v1.6.2
31+
uses: alandefreitas/cpp-actions/cpp-matrix@v1.8.2
3232
id: cpp-matrix
3333
with:
3434
compilers: |
3535
gcc 13.1
36-
clang 16
36+
clang 17
3737
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: ''
4241

4342
build:
4443
needs: cpp-matrix
@@ -54,61 +53,76 @@ jobs:
5453

5554
name: ${{ matrix.name }}
5655
runs-on: ${{ matrix.runs-on }}
57-
container: ${{ matrix.container }}
56+
container: ${{ (matrix.compiler == 'gcc' && 'ubuntu:22.04') || matrix.container }}
57+
env: ${{ matrix.env }}
5858
permissions:
5959
contents: write
6060

6161
steps:
62+
- name: Install git
63+
if: ${{ matrix.container }}
64+
uses: alandefreitas/cpp-actions/[email protected]
65+
with:
66+
apt-get: git
67+
6268
- name: Clone MrDocs
6369
uses: actions/checkout@v3
6470

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+
6590
- name: Install LLVM
6691
id: llvm-install
6792
shell: bash
6893
run: |
6994
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"
80106
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
91109
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
97112
llvm_root="${{runner.tool_cache}}/llvm+clang"
98113
llvm_root=$(echo "$llvm_root" | sed 's/\\/\//g')
99114
mkdir -p "$llvm_root"
100-
101115
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
103117
else
104-
7z x "$llvm_archive_filename"
105-
cd "$llvm_config_type"
118+
7z x "$filename"
119+
cd "$config_type"
106120
mv * "$llvm_root"
107121
cd ..
108-
rm -rf "$llvm_config_type"
122+
rm -rf "$config_type"
109123
fi
110124
111-
# Export LLVM_ROOT
125+
# Export
112126
echo "llvm_root=$llvm_root"
113127
echo -E "llvm-root=$llvm_root" >> $GITHUB_OUTPUT
114128
@@ -117,37 +131,18 @@ jobs:
117131
with:
118132
node-version: '18'
119133

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-
139134
- name: CMake Workflow
140-
uses: alandefreitas/cpp-actions/cmake-workflow@v1.6.2
135+
uses: alandefreitas/cpp-actions/cmake-workflow@v1.8.2
141136
with:
142137
cmake-version: '>=3.20'
143-
generator: Ninja
144-
toolchain: ${{ steps.package-install.outputs.vcpkg-toolchain }}
145-
build-type: ${{ matrix.build-type }}
146138
cxxstd: ${{ matrix.cxxstd }}
147139
cc: ${{ steps.setup-cpp.outputs.cc || matrix.cc }}
148140
ccflags: ${{ matrix.ccflags }}
149141
cxx: ${{ steps.setup-cpp.outputs.cxx || matrix.cxx }}
150142
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 }}
151146
install-prefix: .local
152147
extra-args: |
153148
-D LLVM_ROOT="${{ steps.llvm-install.outputs.llvm-root || '/usr/local' }}"
@@ -157,6 +152,8 @@ jobs:
157152
install: true
158153
package: ${{ matrix.is-main }}
159154
package-dir: packages
155+
package-generators: ${{ (runner.os == 'Windows' && '7Z ZIP WIX') || 'TGZ TXZ' }}
156+
package-artifact: false
160157

161158
- name: Upload GitHub Release Artifacts
162159
if: ${{ matrix.is-main && matrix.compiler != 'clang' }}
@@ -167,36 +164,20 @@ jobs:
167164
retention-days: 1
168165

169166
- name: FlameGraph
170-
uses: alandefreitas/cpp-actions/flamegraph@v1.6.2
167+
uses: alandefreitas/cpp-actions/flamegraph@v1.8.2
171168
if: matrix.time-trace
172169
with:
173170
build-dir: build
174171
github_token: ${{ secrets.GITHUB_TOKEN }}
175172

176173
- 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 "[![codecov](https://codecov.io/github/$GITHUB_REPOSITORY/commit/$GITHUB_SHA/graphs/sunburst.svg)](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: [![codecov](https://codecov.io/github/$GITHUB_REPOSITORY/branch/$GITHUB_REF_NAME/graph/badge.svg)](https://codecov.io/github/$GITHUB_REPOSITORY/commit/$GITHUB_SHA)" >> $GITHUB_STEP_SUMMARY
199-
echo "" >> $GITHUB_STEP_SUMMARY
174+
if: ${{ matrix.coverage}}
175+
uses: codecov/[email protected]
176+
with:
177+
directory: './build'
178+
fail_ci_if_error: true
179+
gcov: true
180+
verbose: true
200181

201182
docs:
202183
needs: build
@@ -268,6 +249,8 @@ jobs:
268249
name: Demos
269250
timeout-minutes: 120
270251
runs-on: ubuntu-22.04
252+
container: ubuntu:23.04
253+
271254
permissions:
272255
contents: write
273256

@@ -285,29 +268,29 @@ jobs:
285268
working-directory: packages
286269

287270
- name: Setup C++
288-
uses: alandefreitas/cpp-actions/setup-cpp@v1.6.2
271+
uses: alandefreitas/cpp-actions/setup-cpp@v1.8.2
289272
id: setup-cpp
290273
with:
291274
compiler: clang
292275
version: 16
293276
check-latest: true
294277

295278
- name: Install packages
296-
uses: alandefreitas/cpp-actions/package-install@v1.6.2
279+
uses: alandefreitas/cpp-actions/package-install@v1.8.2
297280
id: package-install
298281
with:
299-
apt-get: libstdc++-12-dev asciidoctor
282+
apt-get: libstdc++-12-dev asciidoctor cmake bzip2
300283
cc: ${{ steps.setup-cpp.outputs.cc }}
301284
cxx: ${{ steps.setup-cpp.outputs.cxx }}
302285

303286
- name: Install mrdocs from release package
304287
run: |
305288
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 \;
307290
mrdocs --version
308291
309292
- name: Clone Boost.URL
310-
uses: alandefreitas/cpp-actions/boost-clone@v1.6.2
293+
uses: alandefreitas/cpp-actions/boost-clone@v1.8.2
311294
id: boost-url-clone
312295
with:
313296
branch: master
@@ -404,21 +387,13 @@ jobs:
404387
working-directory: build
405388

406389
- name: Create changelog
407-
uses: alandefreitas/cpp-actions/create-changelog@v1.6.2
390+
uses: alandefreitas/cpp-actions/create-changelog@v1.8.2
408391
with:
409392
output-path: CHANGELOG.md
410393
thank-non-regular: ${{ startsWith(github.ref, 'refs/tags/') }}
411394
github-token: ${{ secrets.GITHUB_TOKEN }}
412395
limit: 150
413396

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-
422397
- name: Create GitHub Package Release
423398
if: ${{ github.event_name == 'push' && (contains(fromJSON('["master", "develop"]'), github.ref_name) || startsWith(github.ref, 'refs/tags/')) }}
424399
uses: softprops/action-gh-release@v1
@@ -435,7 +410,7 @@ jobs:
435410
if: ${{ github.event_name == 'push' && contains(fromJSON('["master", "develop"]'), github.ref_name) }}
436411
with:
437412
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') || '' }}
439414
env:
440415
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
441416

src/lib/AST/ASTVisitor.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ class ASTVisitor
242242
getFileSystemOpts().WorkingDir;
243243
// we can't normalize a relative path
244244
// without a base directory
245-
MRDOCS_ASSERT(! cwd.empty());
245+
// MRDOCS_ASSERT(! cwd.empty());
246246
fs::make_absolute(cwd, new_path);
247247
}
248248
// remove ./ and ../

0 commit comments

Comments
 (0)