Skip to content

Commit

Permalink
Update build action.
Browse files Browse the repository at this point in the history
  • Loading branch information
Holt59 committed Jul 9, 2024
1 parent 5be99e7 commit c62aaa3
Showing 1 changed file with 51 additions and 10 deletions.
61 changes: 51 additions & 10 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,61 @@ on:
pull_request:
types: [opened, synchronize, reopened]

env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"

jobs:
build:
runs-on: windows-2022
steps:
- name: Build Plugin Python
id: build-plugin-python
uses: ModOrganizer2/build-with-mob-action@master
# https://learn.microsoft.com/en-us/vcpkg/consume/binary-caching-github-actions-cache
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
setup-python: false
version: 6.7.0
modules:
cache: true

- uses: actions/checkout@v4
- uses: lukka/run-vcpkg@v11

# build uibase
- uses: actions/checkout@v4
with:
mo2-third-parties: gtest python spdlog boost sip pyqt pybind11
mo2-dependencies: cmake_common uibase
mo2-cmake-command: -DPLUGIN_PYTHON_TESTS=1 ..
- name: Build Plugin Python Tests
run: cmake --build vsbuild --config RelWithDebInfo -j4 --target python-tests --target runner-tests
working-directory: ${{ steps.build-plugin-python.outputs.working-directory }}
repository: ModOrganizer2/modorganizer-uibase
ref: dev/vcpkg
path: uibase

- name: Build UIBase
run: |
cmake --preset vs2022-windows `
"-DCMAKE_PREFIX_PATH=${env:QT_ROOT_DIR}\msvc2019_64" `
"-DCMAKE_INSTALL_PREFIX=install"
cmake --build vsbuild --config RelWithDebInfo --target INSTALL
working-directory: uibase

- name: Configure Plugin Python build
shell: pwsh
run: |
cmake --preset vs2022-windows `
"-DCMAKE_PREFIX_PATH=${env:QT_ROOT_DIR}\msvc2019_64;.\uibase\install\lib\cmake" `
-DPLUGIN_PYTHON_TESTING=ON
- name: Build Plugin Python
run: cmake --build vsbuild --config RelWithDebInfo --verbose `
--target python-tests --target runner-tests --target proxy

- name: Test Plugin Python
run: ctest --test-dir vsbuild -C RelWithDebInfo --output-on-failure
working-directory: ${{ steps.build-plugin-python.outputs.working-directory }}

0 comments on commit c62aaa3

Please sign in to comment.