Skip to content

Commit d131a49

Browse files
committed
ci: fixups of analysis workflow (#4572)
* Fix missing secrets that accidentally disabled the analysis workflow a few commits back. After splitting into reusable steps, we needed the main analysis workflow to let the steps workflow inherit secrets. * Run analysis on TOT dev branches. * For analysis, only build OIIO as debug, not dependencies. --------- Signed-off-by: Larry Gritz <[email protected]>
1 parent 632717a commit d131a49

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

.github/workflows/analysis.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,26 @@ on:
1414
# Run on pushes only to main or if the branch name contains "analysis"
1515
branches:
1616
- main
17+
- dev-3.0
1718
- '*analysis*'
1819
- '*sonar*'
1920
paths:
2021
- '**'
2122
- '!**.md'
2223
- '!**.rst'
23-
- '!**/analysis.yml'
24+
- '!**/ci.yml'
2425
- '!**/docs.yml'
2526
- '!**.properties'
2627
- '!docs/**'
28+
# Run analysis on PRs only if the branch name indicates that the purpose of
29+
# the PR is related to the Sonar analysis. We don't run on every PR because
30+
# the analysis run is very expensive and just isn't usually necessary.
31+
pull_request:
32+
branches:
33+
- '*analysis*'
34+
- '*sonar*'
2735
# Allow manual kicking off of the workflow from github.com
2836
workflow_dispatch:
29-
# Uncomment the following line if we want to run analysis on all PRs:
30-
# pull_request:
3137

3238
permissions: read-all
3339

@@ -45,6 +51,8 @@ jobs:
4551
# account credentials.
4652
if: github.repository == 'AcademySoftwareFoundation/OpenImageIO'
4753
uses: ./.github/workflows/build-steps.yml
54+
# Must let the called steps workflow inherit our secrets
55+
secrets: inherit
4856
with:
4957
nametag: ${{ matrix.nametag || 'unnamed!' }}
5058
runner: ${{ matrix.runner || 'ubuntu-latest' }}
@@ -75,7 +83,7 @@ jobs:
7583
fail-fast: false
7684
matrix:
7785
include:
78-
- desc: sonar gcc9/C++14 py39 exr3.1 ocio2.2
86+
- desc: sonar gcc11/C++17 py310 exr3.2 ocio2.3
7987
nametag: static-analysis-sonar
8088
os: ubuntu-latest
8189
container: aswf/ci-osl:2024-clang17
@@ -90,7 +98,7 @@ jobs:
9098
setenvs: export SONAR_SERVER_URL="https://sonarcloud.io"
9199
BUILD_WRAPPER_OUT_DIR=/__w/OpenImageIO/OpenImageIO/bw_output
92100
OIIO_CMAKE_BUILD_WRAPPER="build-wrapper-linux-x86-64 --out-dir /__w/OpenImageIO/OpenImageIO/bw_output"
93-
CMAKE_BUILD_TYPE=Debug
101+
OIIO_CMAKE_BUILD_TYPE=Debug
94102
CMAKE_UNITY_BUILD=OFF
95103
CODECOV=1
96104
CTEST_TEST_TIMEOUT=1200

sonar-project.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sonar.host.url=https://sonarcloud.io
66
# Required metadata
77
sonar.organization=academysoftwarefoundation
88
sonar.projectName=OpenImageIO
9-
sonar.projectVersion=2.6
9+
sonar.projectVersion=3.1
1010
sonar.projectKey=AcademySoftwareFoundation_OpenImageIO
1111

1212
# Project links

src/build-scripts/ci-build.bash

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ OIIO_CMAKE_FLAGS="$MY_CMAKE_FLAGS $OIIO_CMAKE_FLAGS"
1212
export OIIO_SRC_DIR=${OIIO_SRC_DIR:=$PWD}
1313
export OIIO_BUILD_DIR=${OIIO_BUILD_DIR:=${OIIO_SRC_DIR}/build}
1414
export OIIO_INSTALL_DIR=${OIIO_INSTALL_DIR:=${OIIO_SRC_DIR}/dist}
15+
export OIIO_CMAKE_BUILD_TYPE=${OIIO_CMAKE_BUILD_TYPE:=${CMAKE_BUILD_TYPE:=Release}}
1516

1617
if [[ "$USE_SIMD" != "" ]] ; then
1718
OIIO_CMAKE_FLAGS="$OIIO_CMAKE_FLAGS -DUSE_SIMD=$USE_SIMD"
@@ -32,7 +33,7 @@ fi
3233

3334
# pushd $OIIO_BUILD_DIR
3435
cmake -S $OIIO_SRC_DIR -B $OIIO_BUILD_DIR -G "$CMAKE_GENERATOR" \
35-
-DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" \
36+
-DCMAKE_BUILD_TYPE="${OIIO_CMAKE_BUILD_TYPE}" \
3637
-DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH" \
3738
-DCMAKE_INSTALL_PREFIX="$OpenImageIO_ROOT" \
3839
-DPYTHON_VERSION="$PYTHON_VERSION" \

0 commit comments

Comments
 (0)