From 194e705f2c1575c2fcb3c338d93b093e51d94be0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Capelle?= Date: Sun, 9 Jul 2023 21:51:55 +0200 Subject: [PATCH] Update workflow to use current branch for dependencies. --- .github/workflows/build.yml | 18 ++++++++++++------ src/pluginmanager.cpp | 2 +- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1fcaa364d..ef06faa6f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,6 +4,8 @@ on: branches: master pull_request: types: [opened, synchronize, reopened] +env: + MO_BRANCH: ${{ github.head_ref || github.ref_name }} jobs: build: runs-on: windows-2022 @@ -22,7 +24,7 @@ jobs: key: ${{ runner.OS }}-mob-cache-${{ hashFiles('mob/.git/refs/heads/master') }} restore-keys: | ${{ runner.OS }}-mob-cache- - - if: ${{ steps.cache-mob.outputs.cache-hit != 'true' }} + - if: steps.cache-mob.outputs.cache-hit != 'true' name: Build mob run: .\mob\bootstrap.ps1 - name: Install Qt @@ -42,13 +44,13 @@ jobs: key: ${{ runner.OS }}-mo2-dependencies-${{ hashFiles('mob/.git/refs/heads/master') }} restore-keys: | ${{ runner.OS }}-mo2-dependencies- - - if: ${{ steps.cache-dependencies.outputs.cache-hit != 'true' }} + - if: steps.cache-dependencies.outputs.cache-hit != 'true' name: Build dependencies with mob run: .\mob\mob.exe -l 4 -d . build - 7z zlib fmt gtest libbsarch libloot openssl libffi bzip2 python lz4 spdlog - boost boost-di sip pyqt pybind11 ss licenses explorerpp usvfs + 7z zlib fmt gtest libbsarch libloot openssl libffi bzip2 lz4 spdlog + boost ss licenses explorerpp usvfs - name: Build dependencies log uses: actions/upload-artifact@v3 with: @@ -57,13 +59,17 @@ jobs: mob.log # TODO: cache this? - name: Build cmake_common and uibase - run: .\mob\mob.exe -l 4 -d . build + run: .\mob\mob.exe -l 4 -d . + -s task/mo_fallback=master -s task/mo_branch=${MO_BRANCH} + build --ignore-uncommitted-changes --redownload --reextract --reconfigure --rebuild cmake_common uibase # TODO: cache this? - name: Build ModOrganizer dependencies - run: .\mob\mob.exe -l 4 -d . build + run: .\mob\mob.exe -l 4 -d . + -s task/mo_fallback=master -s task/mo_branch=${MO_BRANCH} + build --ignore-uncommitted-changes --redownload --reextract --reconfigure --rebuild githubpp bsatk esptk archive lootcli game_gamebryo diff --git a/src/pluginmanager.cpp b/src/pluginmanager.cpp index f81a590b3..0abd7fcf6 100644 --- a/src/pluginmanager.cpp +++ b/src/pluginmanager.cpp @@ -499,7 +499,7 @@ bool PluginManager::loadPlugins(const MOBase::PluginExtension& extension) // find the best interface auto it = std::min_element(std::begin(objectGroup), std::end(objectGroup), - [&](auto const& lhs, auto const& rhs) { + [&](auto const& lhs, auto const& rhs) { return isBetterInterface(lhs, rhs); }); IPlugin* master = qobject_cast(*it);