Skip to content

Commit 57e8bb3

Browse files
committed
Update GH Action to use custom MO2 action.
1 parent 6abd2d1 commit 57e8bb3

3 files changed

Lines changed: 13 additions & 20 deletions

File tree

.github/workflows/build.yml

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,43 +23,36 @@ jobs:
2323
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
2424
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
2525
26-
- name: Install Qt
27-
uses: jurplel/install-qt-action@v3
26+
- name: Configure UIBase
27+
id: configure-uibase
28+
uses: ModOrganizer2/build-with-mob-action@dev/vcpkg
2829
with:
29-
version: 6.7.1
30-
modules:
31-
cache: true
32-
33-
- uses: actions/checkout@v4
34-
- uses: lukka/run-vcpkg@v11
35-
36-
- name: Configure UI Base build
37-
shell: pwsh
38-
run: |
39-
cmake --preset vs2022-windows-standalone `
40-
"-DCMAKE_PREFIX_PATH=${env:QT_ROOT_DIR}\msvc2019_64" `
41-
"-DCMAKE_INSTALL_PREFIX=install" -DUIBASE_TESTING=ON
30+
# skip build because we are going to build both Debug and RelWithDebInfo here
31+
mo2-skip-build: true
4232

4333
# build both Debug and RelWithDebInfo for package
4434
- name: Build UI Base
35+
working-directory: ${{ steps.configure-uibase.outputs.working-directory }}
4536
run: |
4637
cmake --build vsbuild --config Debug --target uibase-tests --verbose
4738
cmake --build vsbuild --config RelWithDebInfo --target uibase-tests --verbose
4839
4940
- name: Test UI Base
41+
working-directory: ${{ steps.configure-uibase.outputs.working-directory }}
5042
run: |
5143
ctest --test-dir vsbuild -C Debug --output-on-failure
5244
ctest --test-dir vsbuild -C RelWithDebInfo --output-on-failure
5345
5446
- name: Install UI Base
47+
working-directory: ${{ steps.configure-uibase.outputs.working-directory }}
5548
run: |
5649
cmake --install vsbuild --config Debug
5750
cmake --install vsbuild --config RelWithDebInfo
5851
5952
# this tests that UI Base can be properly used as a CMake package
6053
- name: Test UI Base package
6154
run: |
62-
cmake -B build . "-DCMAKE_PREFIX_PATH=${env:QT_ROOT_DIR}\msvc2019_64;..\..\install\lib\cmake\"
55+
cmake -B build . "-DCMAKE_PREFIX_PATH=${env:QT_ROOT_DIR}\msvc2022_64;..\..\install\lib\cmake\"
6356
cmake --build build --config Debug
6457
cmake --build build --config Release
6558
cmake --build build --config RelWithDebInfo

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ install(FILES
3737
DESTINATION lib/cmake/mo2-uibase
3838
)
3939

40-
set(UIBASE_TESTING ${UIBASE_TESTING} CACHE BOOL "build tests for uibase")
41-
if (UIBASE_TESTING)
40+
set(BUILD_TESTING ${BUILD_TESTING} CACHE BOOL "build tests for uibase")
41+
if (BUILD_TESTING)
4242
enable_testing()
4343
add_subdirectory(tests)
4444
endif()

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ $env:VCPKG_ROOT = "C:\vcpkg"
1414
1515
cmake --preset vs2022-windows "-DCMAKE_PREFIX_PATH=$env:QT_ROOT" `
1616
-DCMAKE_INSTALL_PREFIX=install `
17-
-DUIBASE_TESTING=ON
17+
-DBUILD_TESTING=ON
1818
1919
# build uibase
2020
cmake --build vsbuild --config RelWithDebInfo
@@ -29,7 +29,7 @@ ctest --test-dir vsbuild -C RelWithDebInfo --output-on-failure
2929
Check [`CMakePresets.json`](CMakePresets.json) for some predefined values. Extra options
3030
include:
3131

32-
- `UIBASE_TESTING` - if specified, build tests for UIBase, requires the VCPKG `testing`
32+
- `BUILD_TESTING` - if specified, build tests for UIBase, requires the VCPKG `testing`
3333
feature to be enabled (enabled in the preset).
3434

3535
## How to use?

0 commit comments

Comments
 (0)