-
Notifications
You must be signed in to change notification settings - Fork 11
203 lines (177 loc) · 7.59 KB
/
vcpkg_ci_windows.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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
name: Windows Continuous Integration
env:
# "Source" is set in the setup-dotnet action
VCPKG_BINARY_SOURCES: 'clear;nuget,Source,readwrite;nugettimeout,3601'
TRIPLET: 'x64-windows-static-md-rel'
VCPKG_DEFAULT_HOST_TRIPLET: 'x64-windows-static-md-rel'
on:
release:
types:
- published
pull_request:
paths-ignore:
- 'docker/**'
- '.github/**'
- '**.md'
- 'old/**'
- '!.github/workflows/vcpkg_ci_windows.yml'
push:
paths-ignore:
- 'docker/**'
- '.github/**'
- '**.md'
- 'old/**'
- '!.github/workflows/vcpkg_ci_windows.yml'
tags-ignore:
- 'v*'
branches:
- 'master'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
fail-fast: false
matrix:
llvm: [
'llvm-15',
'llvm-16'
]
runs-on: ['self-hosted', 'Windows', 'X64']
env:
ARTIFACT_NAME: vcpkg_windows-vs2019_${{ matrix.llvm }}_amd64
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.after }}
submodules: false
- name: Get commit message
run: |
Add-Content -Path $env:GITHUB_ENV -Encoding UTF8 -Value 'COMMIT_MESSAGE<<EOF'
Add-Content -Path $env:GITHUB_ENV -Encoding UTF8 -Value "$(git log --format=%B -n 1 ${{ github.event.after }})"
Add-Content -Path $env:GITHUB_ENV -Encoding UTF8 -Value 'EOF'
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '3.1.x' # SDK Version to use.
# Sets as "Source"
source-url: https://nuget.pkg.github.com/lifting-bits/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Read vcpkg Info
id: vcpkg_info
shell: bash
run: |
{ read -r vcpkg_repo_url && read -r vcpkg_commit; } < ./vcpkg_info.txt || exit 1
echo "repo_url=${vcpkg_repo_url}" >> ${GITHUB_OUTPUT}
echo "commit=${vcpkg_commit}" >> ${GITHUB_OUTPUT}
# Setup Visual Studio Dev Environment (x64, default version/toolset)
- uses: ilammy/[email protected]
- name: Clear prior vcpkg directory
run: |
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "${{ github.workspace }}\vcpkg"
Add-Content -Path $env:GITHUB_ENV -Encoding UTF8 -Value 'VCPKG_ROOT=${{ github.workspace }}\vcpkg'
- name: 'Checkout and Bootstrap vcpkg'
run: |
git clone ${{ steps.vcpkg_info.outputs.repo_url }} "${env:VCPKG_ROOT}"
git -C "${env:VCPKG_ROOT}" checkout ${{ steps.vcpkg_info.outputs.commit }}
& "${env:VCPKG_ROOT}\bootstrap-vcpkg.bat"
env:
VCPKG_DISABLE_METRICS: 1
# Omit this step if using manifests
- name: 'vcpkg install dependencies'
env:
VCPKG_DISABLE_METRICS: 1
run: |
# Setup NuGet authentication
& "$(& "${env:VCPKG_ROOT}\vcpkg.exe" fetch nuget | select -last 1)" setapikey `
-source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" `
"${{ secrets.GITHUB_TOKEN }}"
& "${env:VCPKG_ROOT}\vcpkg.exe" install `
--triplet "${env:TRIPLET}" `
--debug `
${{ matrix.llvm }} `
"@overlays.txt" `
"@dependencies.txt"
- name: 'Export Packages'
if: contains(env.COMMIT_MESSAGE, 'debug artifacts') || github.event.release
run: |
& "${env:VCPKG_ROOT}\vcpkg.exe" export `
--x-all-installed `
--debug `
"@overlays.txt" `
--7zip `
--output=${{ env.ARTIFACT_NAME }}
- name: Publish Release Assets
if: github.event.release
uses: softprops/action-gh-release@v2
with:
files: ${{ env.ARTIFACT_NAME }}
prerelease: ${{ contains(github.ref, 'pre') || contains(github.ref, 'rc') }}
token: ${{ secrets.RELEASE_TOKEN }}
- uses: actions/upload-artifact@v4
if: contains(env.COMMIT_MESSAGE, 'debug artifacts')
with:
name: ${{ env.ARTIFACT_NAME }}.7z
path: ${{ env.VCPKG_ROOT }}/${{ env.ARTIFACT_NAME }}.7z
- name: 'Test rellic build'
if: ${{ matrix.llvm == 'llvm-15' }}
run: |
cd rellic
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue .\build
New-Item -Path .\build -ItemType Directory
cd build
cmake -T ClangCl `
-DCMAKE_VERBOSE_MAKEFILE=ON `
-DVCPKG_ROOT="${env:VCPKG_ROOT}" `
-DCMAKE_INSTALL_PREFIX="$(pwd)\install" `
..
cmake --build . --config Release -j
cmake --build . --config Release --target install
# TODO Testing on Windows
# python ../scripts/roundtrip.py ( Get-ChildItem tools | Where-Object {$_.name -match "rellic-decomp.exe"} ) ..\tests\tools\decomp "${env:VCPKG_ROOT}\installed\${env:TRIPLET}\tools\${{ matrix.llvm }}\clang.exe"
- name: 'Test remill build'
run: |
cd remill
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue .\build
New-Item -Path .\build -ItemType Directory
cd build
cmake -T ClangCl `
-DCMAKE_VERBOSE_MAKEFILE=ON `
-DVCPKG_ROOT="${env:VCPKG_ROOT}" `
-DCMAKE_INSTALL_PREFIX="$(pwd)\install" `
..
cmake --build . --config Release -j
cmake --build . --config Release --target install
& ( Get-ChildItem install\bin | Where-Object {$_.name -match "remill-lift-.*.exe"} ) --arch amd64 --ir_out CON --bytes c704ba01000000
& ( Get-ChildItem install\bin | Where-Object {$_.name -match "remill-lift-.*.exe"} ) --arch aarch64 --ir_out CON --address 0x400544 --bytes FD7BBFA90000009000601891FD030091B7FFFF97E0031F2AFD7BC1A8C0035FD6
& ( Get-ChildItem install\bin | Where-Object {$_.name -match "remill-lift-.*.exe"} ) --arch aarch32 -ir_out CON --bytes 0cd04de208008de504108de500208de508309de504009de500109de5903122e0c20fa0e110109fe5001091e5002081e5040081e50cd08de21eff2fe14000000000000000
# TODO Testing with CMake on Windows
# cmake --build . --target test_dependencies
# env CTEST_OUTPUT_ON_FAILURE=1 cmake --build . --target test || true
- name: 'Anvill build'
if: ${{ matrix.llvm == 'llvm-15' }}
run: |
cd anvill
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue .\build
New-Item -Path .\build -ItemType Directory
cd build
cmake -T ClangCl `
-DCMAKE_VERBOSE_MAKEFILE=ON `
-DCMAKE_INSTALL_PREFIX="$(pwd)\install" `
-DVCPKG_ROOT="${env:VCPKG_ROOT}" `
-DANVILL_ENABLE_INSTALL_TARGET=ON `
-DANVILL_ENABLE_PYTHON3_LIBS=OFF `
-Dremill_DIR="$(pwd)\..\..\remill\build\install\lib\cmake\remill" `
..
cmake --build . --config Release -j
cmake --build . --config Release --target install
& ( Get-ChildItem install\bin | Where-Object {$_.name -match "anvill-decompile-json.exe"} ) -spec ..\bin\Decompile\tests\specs\ret0.json -bc_out ret0.bc -ir_out ret0.ir
- name: Cache cleanup
run: |
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "${env:VCPKG_ROOT}\buildtrees"
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "${env:VCPKG_ROOT}\installed"
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "${env:VCPKG_ROOT}\packages"