From e6190bf4f7d209d0652a7a491edb24b679ab95c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Capelle?= Date: Sun, 9 Jul 2023 16:30:37 +0200 Subject: [PATCH] Add basic Github CI action for testing. --- .github/workflows/build-and-test.yml | 72 ++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 .github/workflows/build-and-test.yml diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml new file mode 100644 index 0000000..12883f3 --- /dev/null +++ b/.github/workflows/build-and-test.yml @@ -0,0 +1,72 @@ +name: Build Plugin Python +on: [push] +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 . 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 + - name: Test Plugin Python + run: ctest --test-dir vsbuild -C RelWithDebInfo --output-on-failure + working-directory: ./build/modorganizer_super/plugin_python