Skip to content

Commit d1b9078

Browse files
committed
ci: port OIIO improvements - shared steps, upgrade to new actions
OpenImageIO and OSL have similar CI infrastructure, mostly share a design of such, and copy the files back and forth to synchronize from time to time. Turns out it's been a while since the last sync, and a lot of small improvements have accumulated on the OIIO side. * Bump our CI workflow externally-hosted actions to the latest versions. * Use shared-steps workflow for the old aswf container jobs. * Split some of the steps of the shared-steps workflow into "old" and "new" in cases where the 2022 ASWF docker containers containers cannot run the latest actions, only update those to the most recent that are able for those containers. * Restore bleeding edge test to pybind11 master -- the reason we locked it down has since been fixed on the OIIO side. Signed-off-by: Larry Gritz <lg@larrygritz.com>
1 parent d9dfaa2 commit d1b9078

File tree

2 files changed

+141
-104
lines changed

2 files changed

+141
-104
lines changed

.github/workflows/build-steps.yml

Lines changed: 95 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ on:
4040
type: string
4141
fmt_ver:
4242
type: string
43+
fmt_commit:
44+
type: string
45+
gcc_action_ver:
46+
type: string
47+
llvm_action_ver:
48+
type: string
4349
opencolorio_ver:
4450
type: string
4551
openexr_ver:
@@ -48,9 +54,9 @@ on:
4854
type: string
4955
pybind11_ver:
5056
type: string
51-
python_ver:
57+
python_action_ver:
5258
type: string
53-
llvm_action_ver:
59+
python_ver:
5460
type: string
5561
setenvs:
5662
type: string
@@ -62,6 +68,8 @@ on:
6268
type: string
6369
abi_check:
6470
type: string
71+
benchmark:
72+
type: string
6573
build_docs:
6674
type: string
6775
clang_format:
@@ -76,8 +84,17 @@ on:
7684
type: string
7785
sonar:
7886
type: string
87+
old_node:
88+
type: string
89+
default: 0
7990
nametag:
8091
type: string
92+
required_deps:
93+
type: string
94+
optional_deps:
95+
type: string
96+
build_local_deps:
97+
type: string
8198
secrets:
8299
PASSED_GITHUB_TOKEN:
83100
required: false
@@ -111,6 +128,7 @@ jobs:
111128
USE_SIMD: ${{inputs.simd}}
112129
FMT_VERSION: ${{inputs.fmt_ver}}
113130
fmt_BUILD_VERSION: ${{inputs.fmt_ver}}
131+
fmt_GIT_COMMIT: ${{inputs.fmt_commit}}
114132
OPENCOLORIO_VERSION: ${{inputs.opencolorio_ver}}
115133
OPENEXR_VERSION: ${{inputs.openexr_ver}}
116134
OPENIMAGEIO_VERSION: ${{inputs.openimageio_ver}}
@@ -120,13 +138,31 @@ jobs:
120138
ABI_CHECK: ${{inputs.abi_check}}
121139
ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION: node16
122140
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
141+
# For CI, sometimes we want to require all dependencies to be present,
142+
# except for a select few listed explicitly. This ensures that we don't
143+
# accidentally have a situation in which we think we are building
144+
# against and testing an optional dependency, but in fact are not.
145+
OSL_REQUIRED_DEPS: ${{inputs.required_deps}}
146+
OSL_OPTIONAL_DEPS: ${{inputs.optional_deps}}
147+
OSL_BUILD_LOCAL_DEPS: ${{inputs.build_local_deps}}
123148
SETENVS: ${{inputs.setenvs}}
124149
DEPCMDS: ${{inputs.depcmds}}
125150

126151
steps:
127-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
128-
with:
129-
fetch-depth: '0'
152+
# Install nodejs 20 with glibc 2.17, to work around the face that the
153+
# GHA runners are insisting on a node version that is too new for the
154+
# glibc in the ASWF containers prior to 2023.
155+
- name: install nodejs20glibc2.17
156+
if: inputs.old_node == '1'
157+
run: |
158+
curl --silent https://unofficial-builds.nodejs.org/download/release/v20.18.1/node-v20.18.1-linux-x64-glibc-217.tar.xz | tar -xJ --strip-components 1 -C /node20217 -f -
159+
- name: Checkout repo
160+
if: inputs.old_node != '1'
161+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
162+
- name: Checkout repo-OLD
163+
if: inputs.old_node == '1'
164+
# Must use an old checkout action for old containers
165+
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
130166
- name: Install LLVM and Clang
131167
if: inputs.llvm_action_ver != ''
132168
uses: KyleMayes/install-llvm-action@ebc0426251bc40c7cd31162802432c68818ab8f0 # v2.0.9
@@ -142,13 +178,34 @@ jobs:
142178
shell: bash
143179
run: echo "date=`date -u +'%Y-%m-%dT%H:%M:%SZ'`" >> $GITHUB_OUTPUT
144180
- name: ccache-restore
181+
if: inputs.old_node != '1'
145182
id: ccache-restore
183+
uses: actions/cache/restore@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
184+
with:
185+
path: ${{ env.CCACHE_DIR }}
186+
key: ${{inputs.nametag}}-${{steps.ccache_cache_keys.outputs.date}}
187+
restore-keys: ${{inputs.nametag}}
188+
- name: ccache-restore-OLD
189+
if: inputs.old_node == '1'
190+
id: ccache-restore-old
191+
# Must use an old cache restore action for old containers
146192
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
147193
with:
148194
path: ${{ env.CCACHE_DIR }}
149195
# path: ./ccache
150196
key: ${{inputs.nametag}}-${{steps.ccache_cache_keys.outputs.date}}
151197
restore-keys: ${{inputs.nametag}}
198+
- name: Install gcc
199+
if: inputs.gcc_action_ver != ''
200+
run: |
201+
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
202+
sudo apt-get update -y
203+
sudo apt-get install -y g++-${{inputs.gcc_action_ver}}
204+
- name: Install python
205+
if: inputs.python_action_ver != ''
206+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
207+
with:
208+
python-version: ${{ inputs.python_action_ver }}
152209
- name: Dependencies
153210
shell: bash
154211
run: |
@@ -170,14 +227,14 @@ jobs:
170227
fi
171228
- name: Install sonar-scanner and build-wrapper
172229
if: inputs.sonar == '1'
173-
uses: sonarsource/sonarqube-scan-action@fd88b7d7ccbaefd23d8f36f73b59db7a3d246602 # v6.0.0
230+
uses: sonarsource/sonarqube-scan-action@a31c9398be7ace6bbfaf30c0bd5d415f843d45e9 # v7.0.0
174231
- name: Build
175232
if: inputs.skip_build != '1'
176233
shell: bash
177234
run: src/build-scripts/ci-build.bash
178235
- name: Check out ABI standard
179236
if: inputs.abi_check != ''
180-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
237+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
181238
with:
182239
ref: ${{inputs.abi_check}}
183240
path: abi_standard
@@ -190,7 +247,16 @@ jobs:
190247
src/build-scripts/ci-build.bash
191248
popd
192249
- name: ccache-save
250+
if: inputs.old_node != '1'
193251
id: ccache-save
252+
uses: actions/cache/save@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
253+
with:
254+
path: ${{ env.CCACHE_DIR }}
255+
key: ${{inputs.nametag}}-${{steps.ccache_cache_keys.outputs.date}}
256+
- name: ccache-save-OLD
257+
if: inputs.old_node == '1'
258+
id: ccache-save-old
259+
# Must use an old cache action for old containers
194260
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
195261
with:
196262
path: ${{ env.CCACHE_DIR }}
@@ -199,6 +265,10 @@ jobs:
199265
if: inputs.skip_tests != '1'
200266
shell: bash
201267
run: src/build-scripts/ci-test.bash
268+
- name: Benchmarks
269+
if: inputs.benchmark == '1'
270+
shell: bash
271+
run: src/build-scripts/ci-benchmark.bash
202272
- name: clang-format
203273
if: inputs.clang_format == '1'
204274
shell: bash
@@ -232,14 +302,30 @@ jobs:
232302
cd src/doc
233303
time make doxygen
234304
time make sphinx
235-
- uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
236-
if: ${{ failure() || inputs.build_docs == '1'}}
305+
- name: Upload testsuite debugging artifacts
306+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
307+
if: ${{ inputs.old_node != '1' && (failure() || inputs.build_docs == '1' || inputs.benchmark == '1' || inputs.abi_check != '') }}
308+
with:
309+
name: osl-${{github.job}}-${{inputs.nametag}}
310+
path: |
311+
build/cmake-save
312+
build/compat_reports
313+
build/sphinx
314+
build/benchmarks
315+
build/*.cmake
316+
build/CMake*
317+
build/testsuite/*/*.*
318+
${{ inputs.extra_artifacts }}
319+
- name: Upload testsuite debugging artifacts-OLD
320+
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
321+
if: ${{ inputs.old_node == '1' && (failure() || inputs.build_docs == '1' || inputs.benchmark == '1' || inputs.abi_check != '') }}
237322
with:
238323
name: osl-${{github.job}}-${{inputs.nametag}}
239324
path: |
240325
build/cmake-save
241326
build/compat_reports
242327
build/sphinx
328+
build/benchmarks
243329
build/*.cmake
244330
build/CMake*
245331
build/testsuite/*/*.*

0 commit comments

Comments
 (0)