forked from ImageEngine/cortex
-
Notifications
You must be signed in to change notification settings - Fork 0
205 lines (170 loc) · 7.65 KB
/
main.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
name: CI
on:
workflow_dispatch:
push:
branches:
- main
- 'RB-*'
pull_request:
branches:
- main
- 'RB-*'
release:
types: [published]
jobs:
build:
strategy:
# Don't cancel other jobs in the build matrix if one job fails.
fail-fast: false
matrix:
# Rather than generate all permutations of various settings,
# we want to explicitly list each of the variants we want to
# test. We can use `name` to declare the names of our variants,
# and then use `include` to define their settings.
name: [
linux-python2,
linux-python2-debug,
linux-python3,
macos-python2,
windows-python3,
windows-python3-debug
]
include:
- name: linux-python2
os: ubuntu-20.04
buildType: RELEASE
containerImage: ghcr.io/gafferhq/build/build:2.0.0
options: .github/workflows/main/options.posix
dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/5.0.0a3/gafferDependencies-5.0.0a3-Python2-linux.tar.gz
tests: testCore testCorePython testScene testImage testAlembic testUSD testVDB testAppleseed
publish: true
- name: linux-python2-debug
os: ubuntu-20.04
buildType: DEBUG
containerImage: ghcr.io/gafferhq/build/build:2.0.0
options: .github/workflows/main/options.posix
dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/5.0.0a3/gafferDependencies-5.0.0a3-Python2-linux.tar.gz
tests: testCore testCorePython testScene testImage testAlembic testUSD testVDB testAppleseed
publish: false
- name: linux-python3
os: ubuntu-20.04
buildType: RELEASE
containerImage: ghcr.io/gafferhq/build/build:2.0.0
options: .github/workflows/main/options.posix
dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/5.0.0a3/gafferDependencies-5.0.0a3-Python2-linux.tar.gz
tests: testCore testCorePython testScene testImage testAlembic testUSD testVDB testAppleseed
publish: true
- name: macos-python2
os: macos-10.15
buildType: RELEASE
containerImage:
options: .github/workflows/main/options.posix
dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/5.0.0a3/gafferDependencies-5.0.0a3-Python2-osx.tar.gz
# `testAppleseed` currently omitted due to clashes with system image IO frameworks.
tests: testCore testCorePython testScene testImage testAlembic testUSD testVDB
publish: true
- name: windows-python3
os: windows-2016
buildType: RELEASE
options: .github/workflows/main/options.windows
dependenciesURL: https://github.com/hypothetical-inc/gafferDependencies/releases/download/3.1.1/gafferDependencies-3.1.1-Python3-windows.zip
tests: testCore testCorePython testScene testImage testAlembic testUSD testVDB
publish: false
- name: windows-python3-debug
os: windows-2016
buildType: RELWITHDEBINFO
options: .github/workflows/main/options.windows
dependenciesURL: https://github.com/hypothetical-inc/gafferDependencies/releases/download/3.1.1/gafferDependencies-3.1.1-Python3-windows.zip
tests: testCore testCorePython testScene testImage testAlembic testUSD testVDB
publish: false
runs-on: ${{ matrix.os }}
container: ${{ matrix.containerImage }}
steps:
- uses: actions/checkout@v2
- uses: ilammy/msvc-dev-cmd@v1.10.0
with:
sdk: 10.0.17763.0
- name: Install toolchain (Windows)
run: python -m pip install scons
if: runner.os == 'Windows'
- name: Install toolchain (MacOS)
# Prefer `pip install` because it is faster
# than `brew install`.
run: |
sudo pip3 install scons==4.0.1
# Brew installs all manner of headers into `/usr/local/include`, including
# OpenEXR and Imath versions that conflict with our own. We can't stop Clang
# finding them because Clang is hardcoded to look in `/usr/local/include`
# _before_ anything we specify with `-isystem`, despite documentation to the
# contrary. So we nuke the headers.
rm -rf /usr/local/include/*
if: runner.os == 'macOS'
- name: Install toolchain (Linux)
run: |
# The Docker container configures bash shells such that they enable the
# software collections we want. If we could set GitHub's
# `defaults.run.shell` to `bash` then all our build steps would pick up
# this environment automatically. But we can't do that because it
# breaks the build on Windows, and we can't configure a different shell
# per platform because GitHub won't allow it. But we can run _this_
# Linux-only step in bash, and transfer the environment out to be used
# in later steps.
echo $PATH > $GITHUB_PATH
echo LD_LIBRARY_PATH=$LD_LIBRARY_PATH >> $GITHUB_ENV
shell: bash
if: runner.os == 'Linux'
- name: Install Python Modules
run: |
python --version
pip install PyJWT==1.7.1 PyGitHub==1.45
- name: Set Custom Variables
run: |
.github/workflows/main/setBuildVars.py
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CORTEX_BUILD_VARIANT: ${{ matrix.name }}
shell: bash
- name: Install dependencies
# The `$GITHUB_ENV` shenanigans creates an environment variable
# containing the hash of the archive, for use in the cache key
# below.
run: |
echo CORTEX_DEPENDENCIES_HASH=`python config/installDependencies.py --archiveURL ${{ matrix.dependenciesURL }} --dependenciesDir ${{ env.CORTEX_BUILD_NAME }} --outputFormat "{archiveDigest}"` >> $GITHUB_ENV
shell: bash
- name: Install 3Delight
run: |
python ./.github/workflows/main/installDelight.py
echo DELIGHT=$GITHUB_WORKSPACE/3delight >> $GITHUB_ENV
shell: bash
- name: Cache
uses: actions/cache@v1
with:
path: sconsCache
key: ${{ runner.os }}-${{ matrix.containerImage }}-${{env.CORTEX_DEPENDENCIES_HASH}}-${{ matrix.buildType }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-${{ matrix.containerImage }}-${{env.CORTEX_DEPENDENCIES_HASH}}-${{ matrix.buildType }}-
- name: Build
run: |
scons -j 2 install BUILD_TYPE=${{ matrix.buildType }} OPTIONS=${{ matrix.options }} CXXSTD=c++14 BUILD_CACHEDIR=sconsCache
- name: Test
run: |
scons ${{ matrix.tests }} BUILD_TYPE=${{ matrix.buildType }} OPTIONS=${{ matrix.options }} CXXSTD=c++14 BUILD_CACHEDIR=sconsCache
env:
IECORE_RTLD_GLOBAL: 0
- name: Build Package
run: |
tar -czf ${{ env.CORTEX_BUILD_NAME }}.tar.gz ${{ env.CORTEX_BUILD_NAME }}
if: matrix.publish
- uses: actions/upload-artifact@v2
with:
name: ${{ env.CORTEX_BUILD_NAME }}
path: ${{ env.CORTEX_BUILD_NAME }}.tar.gz
if: matrix.publish
- name: Publish Release
run: |
./.github/workflows/main/publishRelease.py --archive ${{ env.CORTEX_BUILD_NAME }}.tar.gz --repo ${{ github.repository }} --releaseId ${{ env.CORTEX_GITHUB_RELEASEID }}
if: matrix.publish && env.CORTEX_GITHUB_RELEASEID != '' && runner.os != 'Windows'
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Limit cache size
run: python ./.github/workflows/main/limitCacheSize.py