Skip to content

Commit

Permalink
Add test which compiles the example plugin against release package.
Browse files Browse the repository at this point in the history
  • Loading branch information
karliss committed Sep 13, 2024
1 parent 8a8a5b2 commit e7806bc
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 1 deletion.
107 changes: 107 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,13 @@ jobs:
asset_path: ${{ env.PACKAGE_PATH }}
asset_name: ${{ env.PACKAGE_NAME }}
asset_content_type: ${{ env.UPLOAD_ASSET_TYPE }}
- name: Set output
id: output_setup
if: ${{ matrix.name == 'linux-x86_64' }}
run: |
echo "artifact_name=$PACKAGE_NAME" >> "$GITHUB_OUTPUT"
outputs:
artifact_linux: ${{ steps.output_setup.outputs.artifact_name }}
build-linux-old:
name: ${{ matrix.name }}
runs-on: ubuntu-latest
Expand Down Expand Up @@ -394,10 +401,12 @@ jobs:
include:
- python-version: 3.12.x
- system-deps: false
- output-id: ""
- name: windows-x86_64
os: windows-2019
package: true
python-version: 3.12.x
output-id: artifact_windows
- name: macos-x86_64
os: macos-12
arch: x86_64
Expand All @@ -406,6 +415,7 @@ jobs:
os: macos-14
arch: arm64
package: true
output-id: artifact_macos
# Prevent one job from pausing the rest
fail-fast: false
steps:
Expand Down Expand Up @@ -538,3 +548,100 @@ jobs:
asset_path: ${{ env.PACKAGE_PATH }}
asset_name: ${{ env.PACKAGE_NAME }}
asset_content_type: ${{ env.UPLOAD_ASSET_TYPE }}

- name: Set output
if: matrix.output-id != ''
id: output_setup
shell: bash
run: |
echo "${{ matrix.output-id }}=${PACKAGE_NAME}" >> "$GITHUB_OUTPUT"
outputs:
artifact_macos: ${{ steps.output_setup.outputs.artifact_macos }}
artifact_windows: ${{ steps.output_setup.outputs.artifact_windows }}

plugin-test:
name: plugin-test-${{ matrix.name }}
runs-on: ${{ matrix.os }}
needs: [build-linux, build]
strategy:
matrix:
name: [
linux-x86_64,
macos-arm64,
windows,
]
include:
- name: linux-x86_64
os: ubuntu-20.04
artifact-job: build-linux
artifact-output: artifact_linux
- name: macos-arm64
os: macos-14
artifact-job: build
artifact-output: artifact_macos
- name: windows
os: windows-2019
artifact-job: build
artifact-output: artifact_windows
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
path: 'cutter-src-tmp'
persist-credentials: false
# Only needed for QT, in theory could use qt that's sourced in other way.
# But that introduces risk of problems caused by incompatibility between the two versions.
- name: Cutter deps
shell: bash
run: |
echo "PACKAGE_NAME=${{needs[matrix.artifact-job].outputs[matrix.artifact-output] || 'bad_id'}}" >> $GITHUB_ENV
ls -alh
pwd
./cutter-src-tmp/scripts/fetch_deps.sh
cp -r ./cutter-src-tmp/src/plugins/sample-cpp .
rm -r ./cutter-src-tmp/cutter-deps/python/ || true # copying python folder on macOs doesn't work well, it's not needed for plugin compilation
cp -r ./cutter-src-tmp/cutter-deps .
rm -r cutter-src-tmp
ls -alh
pwd
- name: Download cutter build
uses: actions/download-artifact@v4
with:
name: ${{ needs[matrix.artifact-job].outputs[matrix.artifact-output] || 'bad_id2' }}
- name: build-linux
if: contains(matrix.name, 'linux')
run: |
sudo apt-get -y install libxcb1-dev \
libxkbcommon-dev \
libxcb-*-dev \
libegl1 \
mesa-common-dev
ls
chmod +x ./$PACKAGE_NAME
./$PACKAGE_NAME --appimage-extract
cd sample-cpp
mkdir build
cmake -B build -DCMAKE_PREFIX_PATH="$PWD/../squashfs-root/usr/;$PWD/../cutter-deps/qt" --debug-find-pkg=Qt6Widgets -DQT_DEBUG_FIND_PACKAGE=ON
cmake --build build
- name: build-macos
if: contains(matrix.name, 'macos')
run: |
hdiutil attach $PACKAGE_NAME
ls /Volumes/Cutter/
cd sample-cpp
mkdir build
cmake -B build -DCMAKE_PREFIX_PATH="/Volumes/Cutter/Cutter.app/Contents/Resources;../cutter-deps/qt"
cmake --build build
- name: Build windows
if: contains(matrix.name, 'windows')
shell: cmd
run: |
7z.exe x %PACKAGE_NAME%
ren %PACKAGE_NAME:~0,-4% cutter
dir
cd sample-cpp
mkdir build
cmake -B build -DCMAKE_PREFIX_PATH="%CD%/../cutter;%CD%/../cutter-deps/qt"
cmake --build build
2 changes: 1 addition & 1 deletion src/plugins/sample-cpp/CutterSamplePlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <common/TempConfig.h>
#include <common/Configuration.h>
#include <MainWindow.h>
#include <librz/rz_core.h>
#include <rz_core.h>

void CutterSamplePlugin::setupPlugin() {}

Expand Down

0 comments on commit e7806bc

Please sign in to comment.