-
Notifications
You must be signed in to change notification settings - Fork 10
85 lines (75 loc) · 2.79 KB
/
examples.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# SPDX-License-Identifier: Apache-2.0
# Copyright 2023 The Foundry Visionmongers Ltd
name: Examples
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test-notebooks:
name: "Test Notebooks ${{ 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"]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install Dependencies
run: |
python -m pip install .
python -m pip install -r examples/resources/requirements.txt
- name: Test Notebooks
# Execute all the notebooks apart from the Hybrid Plugin System,
# which requires a build of SimpleCppManager
run: >
find examples -maxdepth 1 -name "*.ipynb"
! -name "hybrid_plugin_system.ipynb"
-exec jupyter nbconvert --to html --execute {} \;
test-cpp-notebooks:
# A special job just for the Hybrid Plugin System because it needs a
# C++ build.
name: Test Hybrid Plugin System notebook
runs-on: ubuntu-latest
container:
image: ghcr.io/openassetio/openassetio-build
env:
SIMPLEHYBRIDMANAGER_SUBDIR: examples/resources/hybrid_plugin_system/SimpleHybridManager
steps:
- uses: actions/checkout@v3
- name: Install Dependencies
run: |
python -m pip install .
python -m pip install -r examples/resources/requirements.txt
python -m pip install openassetio-traitgen
- name: Build/install OpenAssetIO
uses: ./.github/build_openassetio
with:
install-prefix: ${{ env.SIMPLEHYBRIDMANAGER_SUBDIR }}/dependencies
- name: Build/install MediaCreation
run: |
cmake -S . -B build -G Ninja
cmake --build build
cmake --install build --prefix $SIMPLEHYBRIDMANAGER_SUBDIR/dependencies
- name: Build/install SimpleHybridManager
run: |
cmake -S src -B build -G Ninja
cmake --build build
cmake --install build --prefix plugin
env:
CMAKE_PREFIX_PATH: dependencies
# Since we're in a Docker container, `github.workspace` doesn't
# give the correct location, except, for some reason, when used
# in a `working-directory` option. See
# https://github.com/actions/runner/issues/2058#issuecomment-1541828550
working-directory: ${{ github.workspace }}/${{ env.SIMPLEHYBRIDMANAGER_SUBDIR }}
- name: Test notebook
run: jupyter nbconvert --to html --execute examples/hybrid_plugin_system.ipynb