-
Notifications
You must be signed in to change notification settings - Fork 10
101 lines (85 loc) · 2.8 KB
/
test.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# 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:
build-openassetio:
name: Build OpenAssetIO
runs-on: ubuntu-latest
container:
image: ghcr.io/openassetio/openassetio-build
steps:
- uses: actions/checkout@v3
- name: Build
uses: ./.github/build_openassetio
test-python:
name: "${{ matrix.os }} python-${{ matrix.python }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["windows-latest", "ubuntu-latest", "macos-latest"]
python: ["3.7", "3.9", "3.10"]
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
needs: build-openassetio
container:
image: aswf/ci-vfxall:2022-clang14.3
steps:
- uses: actions/checkout@v3
- name: Install Traitgen
run: python -m pip install openassetio-traitgen==1.0.0a6
- name: Get OpenAssetIO
uses: actions/download-artifact@v3
with:
name: OpenAssetIO Build
path: ./openassetio-build
- name: Configure CMake build
run: >
cmake -S . -DCMAKE_PREFIX_PATH=`pwd`/openassetio-build -B build -G Ninja
--preset test
- name: Build tests
run: cmake --build build
- name: Test
run: ctest -VV --test-dir build/tests/cpp --parallel 2
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-vfxall:2022-clang14.3
steps:
- uses: actions/checkout@v3
- name: Install Traitgen
run: python -m pip install openassetio-traitgen==1.0.0a6
- 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