Skip to content

Commit e32bcb4

Browse files
committed
Merge branch 'vcpkg_deps_github' into 'master'
Add github workflow job to build openmw on windows using vcpkg deps See merge request OpenMW/openmw!4200
2 parents 9f2d8b6 + 455c090 commit e32bcb4

File tree

10 files changed

+283
-109
lines changed

10 files changed

+283
-109
lines changed

.github/workflows/openmw.yml

Lines changed: 214 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -6,86 +6,228 @@ on:
66

77
env:
88
BUILD_TYPE: RelWithDebInfo
9+
VCPKG_DEPS_REVISION: 14f130a69c29d10ecd31305db45979cf12f0c162
910

1011
jobs:
1112
Ubuntu:
1213
runs-on: ubuntu-latest
1314

1415
steps:
15-
- uses: actions/checkout@v2
16-
17-
- name: Add OpenMW PPA Dependencies
18-
run: sudo add-apt-repository ppa:openmw/openmw; sudo apt-get update
19-
20-
- name: Install Building Dependencies
21-
run: sudo CI/install_debian_deps.sh gcc openmw-deps openmw-deps-dynamic
22-
23-
- name: Prime ccache
24-
uses: hendrikmuhs/ccache-action@v1
25-
with:
26-
key: ${{ matrix.os }}-${{ env.BUILD_TYPE }}
27-
max-size: 1000M
28-
29-
- name: Configure
30-
run: >
31-
cmake .
32-
-D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
33-
-D OPENMW_USE_SYSTEM_RECASTNAVIGATION=ON
34-
-D USE_SYSTEM_TINYXML=ON
35-
-D BUILD_COMPONENTS_TESTS=ON
36-
-D BUILD_OPENMW_TESTS=ON
37-
-D BUILD_OPENCS_TESTS=ON
38-
-D CMAKE_INSTALL_PREFIX=install
39-
40-
- name: Build
41-
run: cmake --build . -- -j$(nproc)
42-
43-
- name: Run components tests
44-
run: ./components-tests
45-
46-
- name: Run OpenMW tests
47-
run: ./openmw-tests
48-
49-
- name: Run OpenMW-CS tests
50-
run: ./openmw-cs-tests
51-
52-
# - name: Install
53-
# shell: bash
54-
# run: cmake --install .
55-
56-
# - name: Create Artifact
57-
# shell: bash
58-
# working-directory: install
59-
# run: |
60-
# ls -laR
61-
# 7z a ../build_artifact.7z .
62-
63-
# - name: Upload Artifact
64-
# uses: actions/upload-artifact@v1
65-
# with:
66-
# path: ./build_artifact.7z
67-
# name: build_artifact.7z
16+
- uses: actions/checkout@v2
17+
18+
- name: Add OpenMW PPA Dependencies
19+
run: sudo add-apt-repository ppa:openmw/openmw; sudo apt-get update
20+
21+
- name: Install Building Dependencies
22+
run: sudo CI/install_debian_deps.sh gcc openmw-deps openmw-deps-dynamic
23+
24+
- name: Prime ccache
25+
uses: hendrikmuhs/ccache-action@v1
26+
with:
27+
key: ${{ matrix.os }}-${{ env.BUILD_TYPE }}
28+
max-size: 1000M
29+
30+
- name: Configure
31+
run: >
32+
cmake .
33+
-D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
34+
-D OPENMW_USE_SYSTEM_RECASTNAVIGATION=ON
35+
-D USE_SYSTEM_TINYXML=ON
36+
-D BUILD_COMPONENTS_TESTS=ON
37+
-D BUILD_OPENMW_TESTS=ON
38+
-D BUILD_OPENCS_TESTS=ON
39+
-D CMAKE_INSTALL_PREFIX=install
40+
41+
- name: Build
42+
run: cmake --build . -- -j$(nproc)
43+
44+
- name: Run components tests
45+
run: ./components-tests
46+
47+
- name: Run OpenMW tests
48+
run: ./openmw-tests
49+
50+
- name: Run OpenMW-CS tests
51+
run: ./openmw-cs-tests
52+
53+
# - name: Install
54+
# shell: bash
55+
# run: cmake --install .
56+
57+
# - name: Create Artifact
58+
# shell: bash
59+
# working-directory: install
60+
# run: |
61+
# ls -laR
62+
# 7z a ../build_artifact.7z .
63+
64+
# - name: Upload Artifact
65+
# uses: actions/upload-artifact@v1
66+
# with:
67+
# path: ./build_artifact.7z
68+
# name: build_artifact.7z
6869

6970
MacOS:
7071
runs-on: macos-latest
7172

7273
steps:
73-
- uses: actions/checkout@v2
74-
75-
- name: Install Building Dependencies
76-
run: CI/before_install.osx.sh
77-
78-
- name: Prime ccache
79-
uses: hendrikmuhs/ccache-action@v1
80-
with:
81-
key: ${{ matrix.os }}-${{ env.BUILD_TYPE }}
82-
max-size: 1000M
83-
84-
- name: Configure
85-
run: |
86-
rm -fr build # remove the build directory
87-
CI/before_script.osx.sh
88-
- name: Build
89-
run: |
90-
cd build
91-
make -j $(sysctl -n hw.logicalcpu) package
74+
- uses: actions/checkout@v2
75+
76+
- name: Install Building Dependencies
77+
run: CI/before_install.osx.sh
78+
79+
- name: Prime ccache
80+
uses: hendrikmuhs/ccache-action@v1
81+
with:
82+
key: ${{ matrix.os }}-${{ env.BUILD_TYPE }}
83+
max-size: 1000M
84+
85+
- name: Configure
86+
run: |
87+
rm -fr build # remove the build directory
88+
CI/before_script.osx.sh
89+
- name: Build
90+
run: |
91+
cd build
92+
make -j $(sysctl -n hw.logicalcpu) package
93+
94+
Windows:
95+
strategy:
96+
fail-fast: true
97+
matrix:
98+
image:
99+
- windows-2019
100+
- windows-2022
101+
102+
name: ${{ matrix.image }}
103+
104+
runs-on: ${{ matrix.image }}
105+
106+
steps:
107+
- uses: actions/checkout@v2
108+
109+
- name: Create directories for dependencies
110+
run: |
111+
mkdir -p ${{ github.workspace }}/deps
112+
mkdir -p ${{ github.workspace }}/deps/Qt
113+
114+
- name: Download prebuilt vcpkg packages
115+
working-directory: ${{ github.workspace }}/deps
116+
run: >
117+
curl --fail --retry 3 -L
118+
-o vcpkg-x64-${{ matrix.image }}-${{ env.VCPKG_DEPS_REVISION }}.7z
119+
https://gitlab.com/OpenMW/openmw-deps/-/raw/main/windows/vcpkg-x64-${{ matrix.image }}-${{ env.VCPKG_DEPS_REVISION }}.7z
120+
121+
- name: Extract archived prebuilt vcpkg packages
122+
working-directory: ${{ github.workspace }}/deps
123+
run: 7z x -y -ovcpkg-x64-${{ matrix.image }}-${{ env.VCPKG_DEPS_REVISION }} vcpkg-x64-${{ matrix.image }}-${{ env.VCPKG_DEPS_REVISION }}.7z
124+
125+
- name: Cache Qt
126+
id: qt-cache
127+
uses: actions/cache@v4
128+
with:
129+
path: ${{ github.workspace }}/deps/Qt/6.6.3/msvc2019_64
130+
key: qt-cache-6.6.3-msvc2019_64-v1
131+
132+
- name: Download aqt
133+
if: steps.qt-cache.outputs.cache-hit != 'true'
134+
working-directory: ${{ github.workspace }}/deps/Qt
135+
run: >
136+
curl --fail --retry 3 -L
137+
-o aqt_x64.exe
138+
https://github.com/miurahr/aqtinstall/releases/download/v3.1.15/aqt_x64.exe
139+
140+
- name: Install Qt with aqt
141+
if: steps.qt-cache.outputs.cache-hit != 'true'
142+
working-directory: ${{ github.workspace }}/deps/Qt
143+
run: .\aqt_x64.exe install-qt windows desktop 6.6.3 win64_msvc2019_64
144+
145+
- uses: ilammy/msvc-dev-cmd@v1
146+
147+
- uses: seanmiddleditch/gha-setup-ninja@master
148+
149+
- name: Configure OpenMW
150+
run: >
151+
cmake
152+
-S .
153+
-B ${{ github.workspace }}/build
154+
-G Ninja
155+
-D CMAKE_BUILD_TYPE=RelWithDebInfo
156+
-D CMAKE_TOOLCHAIN_FILE='${{ github.workspace }}/deps/vcpkg-x64-${{ matrix.image }}-${{ env.VCPKG_DEPS_REVISION }}/scripts/buildsystems/vcpkg.cmake'
157+
-D CMAKE_PREFIX_PATH='${{ github.workspace }}/deps/Qt/6.6.3/msvc2019_64'
158+
-D LuaJit_INCLUDE_DIR='${{ github.workspace }}/deps/vcpkg-x64-${{ matrix.image }}-${{ env.VCPKG_DEPS_REVISION }}/installed/x64-windows/include/luajit'
159+
-D LuaJit_LIBRARY='${{ github.workspace }}/deps/vcpkg-x64-${{ matrix.image }}-${{ env.VCPKG_DEPS_REVISION }}/installed/x64-windows/lib/lua51.lib'
160+
-D BUILD_BENCHMARKS=ON
161+
-D BUILD_COMPONENTS_TESTS=ON
162+
-D BUILD_OPENMW_TESTS=ON
163+
-D BUILD_OPENCS_TESTS=ON
164+
-D OPENMW_USE_SYSTEM_SQLITE3=OFF
165+
-D OPENMW_USE_SYSTEM_YAML_CPP=OFF
166+
-D OPENMW_LTO_BUILD=ON
167+
168+
- name: Build OpenMW
169+
working-directory: ${{ github.workspace }}
170+
run: cmake --build ${{ github.workspace }}/build
171+
172+
- name: Install OpenMW
173+
working-directory: ${{ github.workspace }}
174+
run: cmake --install ${{ github.workspace }}/build --prefix ${{ github.workspace }}/install
175+
176+
- name: Copy missing DLLs
177+
run: |
178+
cp ${{ github.workspace }}/deps/vcpkg-x64-${{ matrix.image }}-${{ env.VCPKG_DEPS_REVISION }}/installed/x64-windows/bin/Release/MyGUIEngine.dll ${{ github.workspace }}/install
179+
cp -Filter *.dll -Recurse ${{ github.workspace }}/deps/vcpkg-x64-${{ matrix.image }}-${{ env.VCPKG_DEPS_REVISION }}/installed/x64-windows/bin/osgPlugins-3.6.5 ${{ github.workspace }}/install
180+
cp ${{ github.workspace }}/deps/vcpkg-x64-${{ matrix.image }}-${{ env.VCPKG_DEPS_REVISION }}/installed/x64-windows/bin/*.dll ${{ github.workspace }}/install
181+
182+
- name: Copy Qt DLLs
183+
working-directory: ${{ github.workspace }}/deps/Qt/6.6.3/msvc2019_64
184+
run: |
185+
cp bin/Qt6Core.dll ${{ github.workspace }}/install
186+
cp bin/Qt6Gui.dll ${{ github.workspace }}/install
187+
cp bin/Qt6Network.dll ${{ github.workspace }}/install
188+
cp bin/Qt6OpenGL.dll ${{ github.workspace }}/install
189+
cp bin/Qt6OpenGLWidgets.dll ${{ github.workspace }}/install
190+
cp bin/Qt6Widgets.dll ${{ github.workspace }}/install
191+
cp bin/Qt6Svg.dll ${{ github.workspace }}/install
192+
mkdir ${{ github.workspace }}/install/styles
193+
cp plugins/styles/qwindowsvistastyle.dll ${{ github.workspace }}/install/styles
194+
mkdir ${{ github.workspace }}/install/platforms
195+
cp plugins/platforms/qwindows.dll ${{ github.workspace }}/install/platforms
196+
mkdir ${{ github.workspace }}/install/imageformats
197+
cp plugins/imageformats/qsvg.dll ${{ github.workspace }}/install/imageformats
198+
mkdir ${{ github.workspace }}/install/iconengines
199+
cp plugins/iconengines/qsvgicon.dll ${{ github.workspace }}/install/iconengines
200+
201+
- name: Move pdb files
202+
run: |
203+
robocopy install pdb *.pdb /MOVE
204+
if ($lastexitcode -lt 8) {
205+
$global:LASTEXITCODE = $null
206+
}
207+
208+
- name: Remove extra pdb files
209+
shell: bash
210+
run: |
211+
rm -rf install/bin
212+
rm -rf install/_deps
213+
214+
- name: Generate CI-ID.txt
215+
shell: bash
216+
env:
217+
GH_TOKEN: ${{ github.token }}
218+
run: |
219+
job_url=$(gh run --repo ${{ github.repository }} view ${{ github.run_id }} --json jobs --jq '.jobs[] | select(.name == "${{ matrix.image }}") | .url')
220+
printf "Ref ${{ github.ref }}\nJob ${job_url}\nCommit ${{ github.sha }}\n" > install/CI-ID.txt
221+
cp install/CI-ID.txt pdb/CI-ID.txt
222+
223+
- name: Store OpenMW archived pdb files
224+
uses: actions/upload-artifact@v4
225+
with:
226+
name: openmw-${{ matrix.image }}-pdb-${{ github.sha }}
227+
path: ${{ github.workspace }}/pdb/*
228+
229+
- name: Store OpenMW build artifacts
230+
uses: actions/upload-artifact@v4
231+
with:
232+
name: openmw-${{ matrix.image }}-${{ github.sha }}
233+
path: ${{ github.workspace }}/install/*

0 commit comments

Comments
 (0)