Skip to content

Commit 7552a3b

Browse files
authored
Merge pull request #2068 from Mab879/windows_gh_actions_build
Build Windows on GitHub Actions
2 parents 996f5a5 + d993387 commit 7552a3b

File tree

1 file changed

+51
-2
lines changed

1 file changed

+51
-2
lines changed

.github/workflows/build.yml

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
7676
build-macos:
7777
# The type of runner that the job will run on
78-
name: Build, Test on MacOS X Latest
78+
name: Build, Test on macOS Latest
7979
runs-on: macos-latest
8080

8181
# Steps represent a sequence of tasks that will be executed as part of the job
@@ -109,4 +109,53 @@ jobs:
109109
- name: Test
110110
run: |
111111
cd $GITHUB_WORKSPACE/build
112-
echo "Tests are so broken for MacOS :("
112+
echo "Tests are so broken for macOS :("
113+
build-windows:
114+
name: Build on Windows
115+
runs-on: windows-latest
116+
env:
117+
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
118+
steps:
119+
- name: Checkout
120+
uses: actions/checkout@v3
121+
122+
- name: Checkout vcpkg
123+
uses: actions/checkout@v3
124+
with:
125+
path: ${{ github.workspace }}/vcpkg
126+
repository: microsoft/vcpkg
127+
fetch-depth: 1
128+
129+
- name: Bootstrap vcpkg
130+
shell: pwsh
131+
run: "${{ github.workspace }}\\vcpkg\\scripts\\bootstrap.ps1 -disableMetrics"
132+
133+
- name: Export GitHub Actions cache environment variables
134+
uses: actions/github-script@v7
135+
with:
136+
script: |
137+
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
138+
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
139+
140+
- name: Install Deps
141+
run: "${{ github.workspace }}\\vcpkg\\vcpkg.exe install curl libxml2 libxslt bzip2 pcre pthreads zlib getopt-win32 xmlsec --triplet x64-windows"
142+
143+
- name: Configure
144+
working-directory: ./build
145+
run: cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_PYTHON3=FALSE -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake ..
146+
147+
- name: Build
148+
run: cmake --build . --config Release
149+
working-directory: ./build
150+
151+
- name: Package
152+
run: cpack
153+
working-directory: build
154+
155+
- name: Upload Artifacts
156+
uses: actions/upload-artifact@v4
157+
with:
158+
name: openscap-win64
159+
path: |-
160+
build\OpenSCAP*.msi
161+
build\OpenSCAP*.msi.sha512

0 commit comments

Comments
 (0)