|
1 | | -name: Build Plugin Python |
| 1 | +name: Build & Test Plugin Python |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | 5 | branches: master |
6 | 6 | pull_request: |
7 | 7 | types: [opened, synchronize, reopened] |
8 | 8 |
|
9 | | -env: |
10 | | - MO_BRANCH: ${{ github.head_ref || github.ref_name }} |
11 | | - |
12 | 9 | jobs: |
13 | 10 | build: |
14 | 11 | runs-on: windows-2022 |
15 | 12 | steps: |
16 | | - - name: Checkout mob |
17 | | - uses: actions/checkout@v3 |
18 | | - with: |
19 | | - repository: modorganizer2/mob |
20 | | - ref: master |
21 | | - path: ./mob |
22 | | - - name: Cache mob |
23 | | - id: cache-mob |
24 | | - uses: actions/cache@v3 |
25 | | - with: |
26 | | - path: | |
27 | | - ./mob/mob.exe |
28 | | - key: ${{ runner.OS }}-mob-cache-${{ hashFiles('mob/.git/refs/heads/master') }} |
29 | | - restore-keys: | |
30 | | - ${{ runner.OS }}-mob-cache- |
31 | | - - if: steps.cache-mob.outputs.cache-hit != 'true' |
32 | | - name: Build mob |
33 | | - run: .\mob\bootstrap.ps1 |
34 | | - - name: Install Qt |
35 | | - uses: jurplel/install-qt-action@v3 |
36 | | - with: |
37 | | - version: 6.5.1 |
38 | | - # modules: qtpositioning qtwebchannel qtwebengine qtwebsockets |
39 | | - cache: true |
40 | | - - name: Add Qt bins to PATH |
41 | | - run: echo "${QT_ROOT_DIR }/msvc2019_64/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append |
42 | | - - name: Cache dependencies |
43 | | - id: cache-dependencies |
44 | | - uses: actions/cache@v3 |
45 | | - with: |
46 | | - path: | |
47 | | - ./build |
48 | | - !./build/modorganizer_super |
49 | | - key: ${{ runner.OS }}-mo2-dependencies-${{ hashFiles('mob/.git/refs/heads/master') }} |
50 | | - restore-keys: | |
51 | | - ${{ runner.OS }}-mo2-dependencies- |
52 | | - - if: steps.cache-dependencies.outputs.cache-hit != 'true' |
53 | | - name: Build dependencies with mob |
54 | | - run: .\mob\mob.exe |
55 | | - -l 4 -d . |
56 | | - build |
57 | | - fmt gtest python spdlog boost sip pyqt pybind11 |
58 | | - - name: Build dependencies log |
59 | | - uses: actions/upload-artifact@v3 |
60 | | - with: |
61 | | - name: build-dependencies-log |
62 | | - path: | |
63 | | - mob.log |
64 | | - # TODO: cache this? |
65 | | - - name: Build cmake_common and uibase |
66 | | - run: .\mob\mob.exe -l 4 -d . |
67 | | - -s task/mo_fallback=master -s task/mo_branch=${{ env.MO_BRANCH }} |
68 | | - build |
69 | | - --ignore-uncommitted-changes |
70 | | - --redownload --reextract --reconfigure --rebuild |
71 | | - cmake_common uibase |
72 | | - - uses: actions/checkout@v3 |
73 | | - with: |
74 | | - path: ./build/modorganizer_super/plugin_python |
75 | 13 | - name: Build Plugin Python |
76 | | - run: | |
77 | | - ..\..\..\mob\mob.exe -l 5 cmake -c "-DPLUGIN_PYTHON_TESTS=1 .." vsbuild |
78 | | - cmake --build vsbuild --config RelWithDebInfo -j4 |
79 | | - cmake --build vsbuild --config RelWithDebInfo -j4 --target python-tests --target runner-tests |
80 | | - working-directory: ./build/modorganizer_super/plugin_python |
| 14 | + id: build-plugin-python |
| 15 | + uses: ModOrganizer2/build-with-mob-action@master |
| 16 | + with: |
| 17 | + mo2-third-parties: fmt gtest python spdlog boost sip pyqt pybind11 |
| 18 | + mo2-dependencies: cmake_common uibase |
| 19 | + mo2-cmake-command: -DPLUGIN_PYTHON_TESTS=1 .. |
| 20 | + - name: Build Plugin Python Tests |
| 21 | + run: cmake --build vsbuild --config RelWithDebInfo -j4 --target python-tests --target runner-tests |
| 22 | + working-directory: ${{ steps.build-plugin-python.outputs.working-directory }} |
81 | 23 | - name: Test Plugin Python |
82 | 24 | run: ctest --test-dir vsbuild -C RelWithDebInfo --output-on-failure |
83 | | - working-directory: ./build/modorganizer_super/plugin_python |
| 25 | + working-directory: ${{ steps.build-plugin-python.outputs.working-directory }} |
0 commit comments