From 5a8d3e1a72bb611fea00763fdf29c21219ab1369 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Capelle?= Date: Mon, 10 Jul 2023 19:58:40 +0200 Subject: [PATCH] Switch to generic mob action. --- .github/workflows/build-and-test.yml | 80 ++++------------------------ .github/workflows/linting.yml | 7 ++- 2 files changed, 17 insertions(+), 70 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 84a3e14..b2d7cf4 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -1,4 +1,4 @@ -name: Build Plugin Python +name: Build & Test Plugin Python on: push: @@ -6,78 +6,20 @@ on: pull_request: types: [opened, synchronize, reopened] -env: - MO_BRANCH: ${{ github.head_ref || github.ref_name }} - jobs: build: runs-on: windows-2022 steps: - - name: Checkout mob - uses: actions/checkout@v3 - with: - repository: modorganizer2/mob - ref: master - path: ./mob - - name: Cache mob - id: cache-mob - uses: actions/cache@v3 - with: - path: | - ./mob/mob.exe - 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' - name: Build mob - run: .\mob\bootstrap.ps1 - - name: Install Qt - uses: jurplel/install-qt-action@v3 - with: - version: 6.5.1 - # modules: qtpositioning qtwebchannel qtwebengine qtwebsockets - cache: true - - name: Add Qt bins to PATH - run: echo "${QT_ROOT_DIR }/msvc2019_64/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - - name: Cache dependencies - id: cache-dependencies - uses: actions/cache@v3 - with: - path: | - ./build - !./build/modorganizer_super - 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' - name: Build dependencies with mob - run: .\mob\mob.exe - -l 4 -d . - build - fmt gtest python spdlog boost sip pyqt pybind11 - - name: Build dependencies log - uses: actions/upload-artifact@v3 - with: - name: build-dependencies-log - path: | - mob.log - # TODO: cache this? - - name: Build cmake_common and uibase - run: .\mob\mob.exe -l 4 -d . - -s task/mo_fallback=master -s task/mo_branch=${{ env.MO_BRANCH }} - build - --ignore-uncommitted-changes - --redownload --reextract --reconfigure --rebuild - cmake_common uibase - - uses: actions/checkout@v3 - with: - path: ./build/modorganizer_super/plugin_python - name: Build Plugin Python - run: | - ..\..\..\mob\mob.exe -l 5 cmake -c "-DPLUGIN_PYTHON_TESTS=1 .." vsbuild - cmake --build vsbuild --config RelWithDebInfo -j4 - cmake --build vsbuild --config RelWithDebInfo -j4 --target python-tests --target runner-tests - working-directory: ./build/modorganizer_super/plugin_python + id: build-plugin-python + uses: ModOrganizer2/build-with-mob-action@master + with: + mo2-third-parties: fmt 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 }} - name: Test Plugin Python run: ctest --test-dir vsbuild -C RelWithDebInfo --output-on-failure - working-directory: ./build/modorganizer_super/plugin_python + working-directory: ${{ steps.build-plugin-python.outputs.working-directory }} diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 6f20ecc..22d7f40 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -1,5 +1,10 @@ name: Lint Plugin Python -on: [push] + +on: + push: + pull_request: + types: [opened, synchronize, reopened] + jobs: lint: runs-on: ubuntu-latest