Skip to content

Commit 43981c8

Browse files
committed
MSVC workflow
1 parent 1dfe986 commit 43981c8

File tree

2 files changed

+77
-32
lines changed

2 files changed

+77
-32
lines changed

.github/workflows/ci.yml

Lines changed: 65 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -23,79 +23,114 @@ jobs:
2323
fail-fast: false
2424
matrix:
2525
include:
26+
- { name: "MSVC 14.3 - C++20", os: windows-2022, cxxstd: '20', cmake_args: -G "Visual Studio 17 2022" -A x64, github_release: true }
2627
- { name: "GCC 12 - C++20", os: ubuntu-22.04, cc: gcc-12, cxx: g++-12, cxxstd: '20', install: g++-12, github_release: true }
2728
- { name: "GCC 11 - C++20", os: ubuntu-22.04, cc: gcc-11, cxx: g++-11, cxxstd: 20, install: g++-11 }
29+
- { name: "Clang 15 - C++20", os: ubuntu-22.04, cc: clang-15, cxx: clang++-15, cxxstd: 20, install: "clang-15 libxml2-utils" }
2830

2931
# no <source_location>
3032
# - { name: "GCC 10 - C++20", os: ubuntu-22.04, cc: gcc-10, cxx: g++-10, cxxstd: 20, install: g++-10 }
3133
# - { name: "GCC 9 - C++20", os: ubuntu-22.04, cc: gcc-9, cxx: g++-9, cxxstd: 20, install: g++-9 }
3234

33-
- { name: "Clang 15 - C++20", os: ubuntu-22.04, cc: clang-15, cxx: clang++-15, cxxstd: 20, install: "clang-15 libxml2-utils" }
34-
3535
# no <source_location>
3636
# - { name: "Clang 14 - C++20", os: ubuntu-22.04, cc: clang-14, cxx: clang++-14, cxxstd: 20, install: clang-14 }
3737
# - { name: "Clang 13 - C++20", os: ubuntu-22.04, cc: clang-13, cxx: clang++-13, cxxstd: 20, install: clang-13 }
3838
# - { name: "Clang 12 - C++20", os: ubuntu-22.04, cc: clang-12, cxx: clang++-12, cxxstd: 20, install: clang-12 }
3939

40-
# There's no LLVM container for MSVC yet
41-
# - { name: "MSVC 14.3 - C++20", os: windows-2022, cxxstd: '17,20', cmake_args: -G "Visual Studio 17 2022" -A x64, }
4240

4341
name: ${{ matrix.name }}
4442
runs-on: ${{ matrix.os }}
45-
container:
46-
image: cppalliance/droneubuntu2204:llvm-731264b
43+
container: ${{ !startsWith( matrix.os , 'windows' ) && 'cppalliance/droneubuntu2204:llvm-731264b' || null }}
4744
permissions:
4845
contents: write
4946

5047
steps:
5148
- uses: actions/checkout@v3
5249

53-
# - name: Environment
54-
# run: |
55-
# for dir in /usr/include/llvm /usr/local/include/llvm /usr/local/clang+llvm/include/llvm /usr/include/clang /usr/local/include/clang /usr/local/clang+llvm/include/clang
56-
# do
57-
# if [ -d "$dir" ]; then
58-
# find "$dir" -type f -name "*.h" -print
59-
# else
60-
# echo "$dir directory does not exist."
61-
# fi
62-
# done
50+
- name: Install LLVM
51+
id: llvm-install
52+
if: ${{ startsWith( matrix.os , 'windows' ) }}
53+
shell: bash
54+
run: |
55+
export AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }}
56+
export AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }}
57+
export AWS_DEFAULT_REGION=${{ secrets.AWS_REGION }}
58+
aws s3 cp s3://${{ secrets.AWS_BUCKET_NAME }}/llvm-install/RelWithDebInfo-731264b0.7z RelWithDebInfo-731264b0.7z
59+
7z x RelWithDebInfo-731264b0.7z -ollvm-install
60+
llvm_dir="./llvm-install/RelWithDebInfo"
61+
llvm_dir="$(readlink -f "$llvm_dir" 2>/dev/null || realpath -e "$llvm_dir" 2>/dev/null || echo "$(pwd)/$llvm_dir")"
62+
echo "llvm-dir=$llvm_dir" >> $GITHUB_OUTPUT
63+
substring="C:/Program Files/Microsoft Visual Studio/2022/Community/DIA SDK/lib/amd64/diaguids.lib;"
64+
sed -i "s|$substring||g" "./llvm-install/RelWithDebInfo/lib/cmake/llvm/LLVMExports.cmake"
6365
6466
- name: Install packages
6567
if: ${{ matrix.install }}
6668
uses: ./.github/actions/package_install
6769
id: package-install
6870
with:
69-
# vcpkg: fmt,openssl,zlib
7071
apt-get: ${{ matrix.install }}
7172

72-
# - name: Boost Clone
73-
# uses: ./.github/actions/boost_clone
74-
# with:
75-
# boost_dir: boost
76-
# branch: ${{ (startsWith(github.ref, 'refs/heads/master') && 'master') || 'develop' }}
77-
# patches: https://github.com/CppAlliance/buffers.git,https://github.com/CppAlliance/http_proto.git,https://github.com/CppAlliance/http_io.git
78-
# modules: url,../../../BoostServerTech
79-
8073
- name: CMake Workflow (C++${{ matrix.cxxstd }})
81-
uses: alandefreitas/cpp-actions/cmake_workflow@master
74+
uses: alandefreitas/cpp-actions/cmake-workflow@master
8275
with:
8376
cxxstd: ${{ matrix.cxxstd }}
8477
cxx: ${{ matrix.cxx }}
8578
cc: ${{ matrix.cc }}
8679
install-prefix: .local
87-
extra-args: ${{ format('-D LLVM_ROOT={0} -D Clang_ROOT={0} -DCMAKE_EXPORT_COMPILE_COMMANDS=ON', '/usr/local') }}
88-
# toolchain: ${{ steps.package-install.outputs.vcpkg_toolchain }}
80+
extra-args: ${{ format('-D LLVM_ROOT={0} -D Clang_ROOT={0} -DCMAKE_EXPORT_COMPILE_COMMANDS=ON', (startsWith( matrix.os , 'windows') && steps.llvm-install.outputs.llvm-dir) || '/usr/local') }}
8981

9082
- name: Create packages
9183
working-directory: ./build
9284
run: cpack
9385

94-
- name: Create GitHub Package Release
86+
- name: Upload GitHub Release Artifacts
9587
if: ${{ matrix.github_release && github.event_name == 'push' && (contains(fromJSON('["master", "develop"]'), github.ref_name) || startsWith(github.ref, 'refs/tags/')) }}
88+
uses: actions/upload-artifact@v3
89+
with:
90+
name: release-packages-${{ runner.os }}
91+
path: build/MrDox-?.?.?-*.*
92+
retention-days: 1
93+
94+
docs:
95+
needs: build
96+
if: ${{ github.event_name == 'push' && (contains(fromJSON('["master", "develop"]'), github.ref_name) || startsWith(github.ref, 'refs/tags/')) }}
97+
defaults:
98+
run:
99+
shell: bash
100+
101+
strategy:
102+
fail-fast: false
103+
matrix:
104+
include:
105+
- { name: 'Create Release Packages', os: ubuntu-22.04 }
106+
107+
name: ${{ matrix.name }}
108+
timeout-minutes: 120
109+
runs-on: ${{matrix.os}}
110+
permissions:
111+
contents: write
112+
113+
steps:
114+
- uses: actions/download-artifact@v3
115+
with:
116+
name: release-packages-Linux
117+
path: build
118+
119+
- uses: actions/download-artifact@v3
120+
with:
121+
name: release-packages-Windows
122+
path: build
123+
124+
- name: List artifacts
125+
run: ls -R
126+
working-directory: build
127+
128+
- name: Create GitHub Package Release
129+
if: ${{ github.event_name == 'push' && (contains(fromJSON('["master", "develop"]'), github.ref_name) || startsWith(github.ref, 'refs/tags/')) }}
96130
uses: softprops/action-gh-release@v1
97131
with:
98132
files: build/MrDox-?.?.?-*.*
99-
tag_name: ${{ github.ref_name || github.ref }}
133+
name: ${{ github.ref_name || github.ref }}
134+
tag_name: ${{ github.ref_name || github.ref }}${{ (!startsWith(github.ref, 'refs/tags/')) && '-release' }}
100135
token: ${{ github.token }}
101136

NOTES.adoc

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
This worked for me:
44

5-
```
5+
[source]
6+
----
67
# From Administrator CMD.EXE,
78
# after running vcvars64.bat
89
@@ -14,7 +15,16 @@ cmake --install . --prefix "C:\Users\vinnie\src\llvm-install\Debug" --config Deb
1415
1516
# MrDox
1617
cmake -G "Visual Studio 17 2022" -A x64 -B bin64 -DCMAKE_PREFIX_PATH="C:\Users\vinnie\src\llvm-install\RelWithDebInfo" -DCMAKE_TOOLCHAIN_FILE="C:\Users\vinnie\src\mrdox\toolchain.cmake"
17-
```
18+
----
19+
20+
The LLVM version used in CI uses the following configuration command:
21+
22+
[source]
23+
----
24+
cmake -S ../llvm/llvm -B . -G "Visual Studio 17 2022" -A x64 -DCMAKE_CONFIGURATION_TYPES="RelWithDebInfo" -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" -DLLVM_ENABLE_IDE=OFF -DLLVM_ENABLE_DIA_SDK=OFF
25+
----
26+
27+
This should generate an LLVM installation without reference to `diaguids.lib`, which is unavailable in CI.
1828

1929
== Implementation notes
2030

0 commit comments

Comments
 (0)