Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to use MediaCreation and general tidy #30

Merged
merged 9 commits into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/build_openassetio_mediacreation/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright 2023 The Foundry Visionmongers Ltd

# Composite action for reuse within other workflows.
# Builds OpenAssetIO-MediaCreation.
# Should be run on a ghcr.io/openassetio/openassetio-build container.

name: Build OpenAssetIO-MediaCreation
description: Builds OpenAssetIO-MediaCreation and publishes an artifact
runs:
using: "composite"
steps:
- name: Checkout OpenAssetIO-MediaCreation
uses: actions/checkout@v3
with:
repository: OpenAssetIO/OpenAssetIO-MediaCreation
path: openassetio-mediacreation-checkout

- name: Build OpenAssetIO-MediaCreation
shell: bash
run: |
cd openassetio-mediacreation-checkout
mkdir build
python -m pip install openassetio-traitgen
cmake -G Ninja -S . -B build
cmake --build build
cmake --install build

- uses: actions/upload-artifact@v3
with:
name: OpenAssetIO-MediaCreation Build
path: openassetio-mediacreation-checkout/build/dist
retention-days: 1
19 changes: 18 additions & 1 deletion .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,16 @@ jobs:
- name: Build
uses: ./.github/build_openassetio

build-openassetio-mediacreation:
name: Build OpenAssetIO-MediaCreation
runs-on: ubuntu-latest
container:
image: ghcr.io/openassetio/openassetio-build
steps:
- uses: actions/checkout@v3
- name: Build
uses: ./.github/build_openassetio_mediacreation

cpp-linters:
name: C++ linters
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -82,9 +92,16 @@ jobs:
name: OpenAssetIO Build
path: ./openassetio-build

- name: Get OpenAssetIO-MediaCreation
uses: actions/download-artifact@v3
with:
name: OpenAssetIO-MediaCreation Build
path: ./openassetio-mediacreation-build

- name: Configure CMake build
run: >
cmake -DCMAKE_PREFIX_PATH="./openassetio-build" -S . -B build -G Ninja
cmake -DCMAKE_PREFIX_PATH="./openassetio-build;./openassetio-mediacreation-build"
-S . -B build -G Ninja
--install-prefix ${{ github.workspace }}/dist
--preset lint

Expand Down
19 changes: 18 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ jobs:
- name: Build
uses: ./.github/build_openassetio

build-openassetio-mediacreation:
name: Build OpenAssetIO-MediaCreation
runs-on: ubuntu-latest
container:
image: ghcr.io/openassetio/openassetio-build
steps:
- uses: actions/checkout@v3
- name: Build
uses: ./.github/build_openassetio_mediacreation

test:
name: Test-Resolver
runs-on: ubuntu-latest
Expand All @@ -36,14 +46,21 @@ jobs:
name: OpenAssetIO Build
path: ./openassetio-build

- name: Get OpenAssetIO-MediaCreation
uses: actions/download-artifact@v3
with:
name: OpenAssetIO-MediaCreation Build
path: ./openassetio-mediacreation-build

- name: Build and install Resolver
run: |
cmake -S . -DCMAKE_PREFIX_PATH="./openassetio-build" -B build
cmake -S . -DCMAKE_PREFIX_PATH="./openassetio-build;./openassetio-mediacreation-build" -B build
cmake --build build
cmake --install build

- run: |
python -m pip install -r tests/requirements.txt
python -m pip install importlib-metadata

# PYTHONPATH here is extended with `/usr/local/lib/python`
# because the USD install on this docker container is odd, and
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ find_package(pxr REQUIRED)

# Find OpenAssetIO
find_package(OpenAssetIO REQUIRED)
find_package(OpenAssetIO-MediaCreation REQUIRED)

# Add Static analysis targets
include(StaticAnalyzers)
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,19 +161,20 @@ To enable debug logging from the resolver.

## Testing

To run tests, from the project root
To run tests, once built, from the project root:

```sh
export PXR_PLUGINPATH_NAME=$(pwd)/build/dist/resources/plugInfo.json
cd tests
python -m pip install -r requirements.txt
pytest
python -m pytest
```

> **Note**
>
> Refer to the [Running](#running) section for the environmental
> prerequisites to run these tests.
> prerequisites to run these tests. The tests will set
> `OPENASSETIO_DEFAULT_CONFIG` appropriately, and unless otherwise
> defined, attempt to set `PXR_PLUGINPATH_NAME` if the standard `build`
> directory was used.

## A note on Python

Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ target_link_libraries(${PLUGIN_NAME}
ar
OpenAssetIO::openassetio-core
OpenAssetIO::openassetio-python-bridge
OpenAssetIO-MediaCreation::openassetio-mediacreation
)

#-----------------------------------------------------------------------
Expand Down
Loading