-
Notifications
You must be signed in to change notification settings - Fork 0
158 lines (134 loc) · 5.34 KB
/
typical-presets.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
name: Typical Presets
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "*" ]
workflow_dispatch:
env:
VCPKG_BINARY_SOURCES: clear;nuget,GitHub,readwrite;nugettimeout,3600
jobs:
build:
strategy:
fail-fast: false
matrix:
vcpkg_target_triplet: ['x64-windows', 'x64-linux']
build_type: ['debug']
include:
- vcpkg_target_triplet: 'x64-linux'
mono: 'mono'
os: 'ubuntu-22.04'
generator: 'make'
- vcpkg_target_triplet: 'x64-windows'
mono: ''
os: 'windows-2022'
VsDevShellArch: 'amd64'
generator: 'vs2022'
permissions:
contents: read
packages: write
runs-on: ${{ matrix.os }}-8-cores
env:
VCPKG_TARGET_TRIPLET: ${{ matrix.vcpkg_target_triplet }}
steps:
- name: Update ubuntu repository
if: ${{ matrix.os == 'ubuntu-22.04' }}
shell: bash
run: sudo apt-get update
- name: Install ubuntu icu dependencies
if: ${{ matrix.os == 'ubuntu-22.04' }}
shell: bash
run: sudo apt-get install autoconf-archive
- name: Install ubuntu qtbase dependencies (documented)
if: ${{ matrix.os == 'ubuntu-22.04' }}
shell: bash
run: sudo apt-get install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev
- name: Install ubuntu qtbase dependencies (undocumented)
if: ${{ matrix.os == 'ubuntu-22.04' }}
shell: bash
run: sudo apt-get install libgl1-mesa-dev mesa-common-dev
- name: Install ubuntu Ninja
if: ${{ matrix.os == 'ubuntu-22.04' }}
shell: bash
run: sudo sudo apt-get install ninja-build
- name: Checkout Repository
uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Bootstrap VCPKG
shell: bash
run: ./vcpkg/bootstrap-vcpkg.sh
- name: Setup NuGet
shell: bash
run: |
${{matrix.mono}} $((./vcpkg/vcpkg fetch nuget) | tail -n 1) sources add \
-source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" \
-storepasswordincleartext \
-name "GitHub" \
-username "${{ github.repository_owner }}" \
-password "${{ secrets.GITHUB_TOKEN }}"
${{matrix.mono}} $((./vcpkg/vcpkg fetch nuget) | tail -n 1) setapikey "${{ secrets.GITHUB_TOKEN }}" \
-source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
${{matrix.mono}} $((./vcpkg/vcpkg fetch nuget) | tail -n 1) sources
- name: Print VsDevShells
if: ${{ matrix.os == 'windows-2022' }}
shell: pwsh
run: |
& "${env:ProgramFiles(x86)}/Microsoft Visual Studio/Installer/vswhere.exe" -requires "Microsoft.VisualStudio.Component.Windows11SDK.*"
- name: CMake Workflow (VsDevShell)
if: ${{ matrix.os == 'windows-2022' }}
shell: pwsh
run: |
$vsInstallationPath=(& "${env:ProgramFiles(x86)}/Microsoft Visual Studio/Installer/vswhere.exe" -requires "Microsoft.VisualStudio.Component.Windows11SDK.*" -property "installationPath")
Import-Module "${vsInstallationPath}/Common7/Tools/Microsoft.VisualStudio.DevShell.dll"
# invoking vcvarsall leaves the shell in another directory...
pushd .
Enter-VsDevShell -VsInstallPath ${vsInstallationPath} -Arch ${{ matrix.VsDevShellArch }}
popd
cmake --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }}
cmake --build --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }}
ctest --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }}
- name: CMake Workflow (non VsDevShell)
if: ${{ matrix.os != 'windows-2022' }}
shell: pwsh
run: |
cmake --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }}
cmake --build --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }}
ctest --preset ci-${{ matrix.generator }}-${{ matrix.vcpkg_target_triplet }}-${{ matrix.build_type }}
- name: Archive VCPKG Log Files
if: always()
uses: actions/upload-artifact@v3
with:
name: buildlogs
path: |
vcpkg/buildtrees/*/*.txt
vcpkg/buildtrees/*/*.log
- name: Create Test Result Artifact
if: always()
uses: actions/upload-artifact@v3
with:
name: Test Results (${{ matrix.vcpkg_target_triplet }})
path: |
build/*.xml
publish-teshresults:
name: Publish Test Results
needs: build
if: >
always() &&
github.event.sender.login != 'dependabot[bot]' &&
( github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository )
runs-on: ubuntu-latest
permissions:
checks: write
pull-requests: write
steps:
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: |
artifacts/**/*.xml