WIP: Another stab at using the GHA GPU runners #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright Contributors to the Open Shading Language project. | |
# SPDX-License-Identifier: BSD-3-Clause | |
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage | |
# GitHub Actions workflow file for CI | |
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions | |
name: CI-GPU | |
on: | |
push: | |
# Skip jobs when only documentation files are changed | |
paths-ignore: | |
- '**.md' | |
- '**.rst' | |
- '**.tex' | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
- '**.rst' | |
- '**.tex' | |
# schedule: | |
# # Full nightly build, for the main project repo (not for forks) | |
# - cron: "0 6 * * *" | |
# if: github.repository == 'AcademySoftwareFoundation/OpenShadingLanguage' | |
permissions: read-all | |
jobs: | |
ubuntu-gpu: | |
name: "Ubuntu GPU ${{matrix.desc}}" | |
if: github.repository == 'AcademySoftwareFoundation/OpenShadingLanguage' && | |
((github.event_name == 'pull_request' && contains(github.head_ref, 'gpu')) || | |
(github.event_name == 'push' || github.event_name == 'schedule')) | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- desc: latest releases gcc11/C++17 llvm15 boost1.71 exr3.2 py3.9 avx2 batch-b16avx512 | |
nametag: linux-latest-releases | |
runner: ubuntu-20.04-gpu-t4-4c-16g-176h | |
cxx_compiler: g++-11 | |
cxx_std: 17 | |
fmt_ver: 10.1.0 | |
openexr_ver: v3.2.1 | |
openimageio_ver: master | |
pybind11_ver: v2.10.0 | |
python_ver: "3.10" | |
simd: avx2,f16c | |
# batched: b8_AVX2,b8_AVX512,b16_AVX512 | |
setenvs: export LLVM_VERSION=15.0.6 | |
LLVM_DISTRO_NAME=ubuntu-18.04 | |
OPENCOLORIO_VERSION=v2.2.0 | |
PUGIXML_VERSION=v1.13 | |
USE_GPU=1 | |
runs-on: ${{matrix.runner}} | |
env: | |
CXX: ${{matrix.cxx_compiler}} | |
CC: ${{matrix.cc_compiler}} | |
CMAKE_CXX_STANDARD: ${{matrix.cxx_std}} | |
FMT_VERSION: ${{matrix.fmt_ver}} | |
OPENEXR_VERSION: ${{matrix.openexr_ver}} | |
OPENIMAGEIO_VERSION: ${{matrix.openimageio_ver}} | |
PYBIND11_VERSION: ${{matrix.pybind11_ver}} | |
PYTHON_VERSION: ${{matrix.python_ver}} | |
USE_BATCHED: ${{matrix.batched}} | |
USE_SIMD: ${{matrix.simd}} | |
steps: | |
# We would like to use harden-runner, but it flags too many false | |
# positives, every time we download a dependency. We should use it only | |
# on CI runs where we are producing artifacts that users might rely on. | |
# - name: Harden Runner | |
# uses: step-security/harden-runner@248ae51c2e8cc9622ecf50685c8bf7150c6e8813 # v1.4.3 | |
# with: | |
# egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs | |
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 | |
- name: Prepare ccache timestamp | |
id: ccache_cache_keys | |
run: echo "::set-output name=date::`date -u +'%Y-%m-%dT%H:%M:%SZ'`" | |
- name: ccache | |
id: ccache | |
uses: actions/cache@c3f1317a9e7b1ef106c153ac8c0f00fed3ddbc0d # v3.0.4 | |
with: | |
path: /tmp/ccache | |
key: ${{github.job}}-${{matrix.nametag}}-${{steps.ccache_cache_keys.outputs.date}} | |
restore-keys: ${{github.job}}-${{matrix.nametag}}- | |
- name: Build setup | |
run: | | |
${{matrix.setenvs}} | |
src/build-scripts/ci-startup.bash | |
- name: Dependencies | |
run: | | |
${{matrix.depcmds}} | |
src/build-scripts/gh-installdeps.bash | |
- name: Build | |
run: src/build-scripts/ci-build.bash | |
- name: Testsuite | |
if: matrix.skip_tests != '1' | |
run: src/build-scripts/ci-test.bash | |
- uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0 | |
if: failure() | |
with: | |
name: osl-${{github.job}}-${{matrix.nametag}} | |
path: | | |
build/cmake-save | |
build/*.cmake | |
build/CMake* | |
build/testsuite/*/*.* |