Add hybrid plugin system notebook #288
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SPDX-License-Identifier: Apache-2.0 | |
# Copyright 2022 The Foundry Visionmongers Ltd | |
# Runs pytest on the matrix of supported platforms any Python versions. | |
name: Test | |
on: | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test-python: | |
name: "${{ matrix.os }} python-${{ matrix.python }}" | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ["windows-2022", "ubuntu-22.04", "macos-13"] | |
python: ["3.10", "3.11"] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
- run: | | |
python -m pip install -r tests/python/requirements.txt | |
python -m pip install . | |
- name: Test | |
run: python -m pytest -v | |
test-cpp: | |
name: Test Cpp | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/openassetio/openassetio-build | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build OpenAssetIO | |
uses: ./.github/build_openassetio | |
with: | |
install-prefix: openassetio | |
- name: Install Traitgen | |
run: python -m pip install openassetio-traitgen==1.0.0a10 | |
- name: Configure CMake build | |
run: | | |
cmake -S . -DCMAKE_PREFIX_PATH=$(pwd)/openassetio -B build -G Ninja --preset test | |
- name: Build tests | |
run: cmake --build build | |
- name: Test | |
run: ctest -VV --test-dir build/tests/cpp --parallel 4 | |
test-python-from-cmake: | |
# To support hybrid C++ applications, the python package may also be | |
# generated using the CMake packaging, in addition and simultaneously | |
# to the C++ package. This tests that. | |
name: "Test Python From CMake" | |
runs-on: ubuntu-latest | |
container: | |
image: aswf/ci-base:2024 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Traitgen | |
run: python -m pip install openassetio-traitgen==1.0.0a10 | |
- name: Configure CMake build | |
run: > | |
cmake -S . -B build -G Ninja | |
-DOPENASSETIO_MEDIACREATION_GENERATE_PYTHON=ON | |
-DOPENASSETIO_MEDIACREATION_PYTHON_SITEDIR="hybridpython" | |
- name: Install package | |
run: cmake --install build | |
- name: Install OpenAssetIO | |
run: python -m pip install openassetio>=1.0.0a6 | |
- name: Test | |
run: | | |
python -m pip install -r tests/python/requirements.txt | |
PYTHONPATH=$(pwd)/build/dist/hybridpython python -m pytest -v | |
disallowed_pip_install: | |
name: Disallowed pip install | |
runs-on: ubuntu-latest | |
container: | |
image: aswf/ci-base:2024 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Traitgen | |
run: python -m pip install openassetio-traitgen==1.0.0a10 | |
- name: Set Python Root Dir | |
run: echo "Python_ROOT_DIR=$(python -c 'import sys; print(sys.prefix)')" >> $GITHUB_ENV | |
- name: Configure CMake build | |
run: > | |
cmake -S . -B build --install-prefix $Python_ROOT_DIR -DOPENASSETIO_MEDIACREATION_GENERATE_PYTHON=ON | |
- name: Install package | |
run: cmake --install build | |
- name: Attempt to install using pip | |
# The runner has pipefail set, so if either the pip install | |
# succeeds (inverted via `!`) or the grep fails, then the step | |
# will fail. | |
run: > | |
! python -m pip install --upgrade --force-reinstall openassetio-mediacreation 2>&1 | |
| grep "The package was installed by cmake" | |
shell: bash |