forked from OpenAssetIO/OpenAssetIO
-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (95 loc) · 3.28 KB
/
build-instructions.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# A simple workflow that runs the documented build steps work.
# Note: Commands in this workflow _must_ be kept in sync with README.md
# until we have an established mechanism to test doc-included code.
name: Build Instructions
on:
pull_request:
branches-ignore:
- docs
paths-ignore:
- 'docs/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
aswf-docker:
name: CY2024
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Build and install (Docker)
run: |
docker run -v `pwd`:/src ghcr.io/openassetio/openassetio-build bash -c '
cd /src && \
cmake -S . -B build && \
cmake --build build --parallel && \
cmake --install build'
- name: Build, install and test (Docker)
run: |
docker run -v `pwd`:/src ghcr.io/openassetio/openassetio-build bash -c '
cd /src && \
cmake -S . -B build -DOPENASSETIO_ENABLE_TESTS=ON && \
ctest --test-dir build --output-on-failure --parallel 4'
pip_install:
name: Pip install on ${{ matrix.config.os }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- os: windows-2022
preamble: call "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Auxiliary\\Build\\vcvarsall.bat" x64
shell: cmd
- os: ubuntu-22.04
shell: bash
- os: macos-12
shell: bash
defaults:
run:
# Annoyingly required here since `matrix` isn't available in
# the `shell` property of individual steps.
shell: ${{ matrix.config.shell }}
steps:
- uses: actions/checkout@v4
- name: Bootstrap
uses: ./.github/bootstrap_platform
- name: Install using pip
run: |
${{ matrix.config.preamble }}
python -m pip install src/openassetio-python
env:
CMAKE_TOOLCHAIN_FILE: ${{ github.workspace }}/.conan/conan_paths.cmake
- name: Install test dependencies
run: pip install -r src/openassetio-python/tests/requirements.txt
- name: Run Python tests
run: pytest src/openassetio-python/tests/package
disallowed_pip_install:
name: Disallowed pip install on ${{ matrix.config.os }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- os: windows-2022
- os: ubuntu-22.04
- os: macos-12
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- name: Bootstrap
uses: ./.github/bootstrap_platform
- name: Build and install via CMake
run: >
cmake -S . -B build
--install-prefix '${{ env.Python_ROOT_DIR }}'
--toolchain '${{ github.workspace }}/.conan/conan_paths.cmake'
cmake --build build --parallel --config Release
cmake --install build --config Release
- name: Attempt to install using pip
# GitHub sets `pipefail`, 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 2>&1
| grep "The package was installed by cmake"