Skip to content

Commit

Permalink
ci: fixups of analysis workflow (#4572)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
lgritz authored Dec 27, 2024
1 parent 8839acc commit af252a1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,26 @@ on:
# Run on pushes only to main or if the branch name contains "analysis"
branches:
- main
- dev-3.0
- '*analysis*'
- '*sonar*'
paths:
- '**'
- '!**.md'
- '!**.rst'
- '!**/analysis.yml'
- '!**/ci.yml'
- '!**/docs.yml'
- '!**.properties'
- '!docs/**'
# Run analysis on PRs only if the branch name indicates that the purpose of
# the PR is related to the Sonar analysis. We don't run on every PR because
# the analysis run is very expensive and just isn't usually necessary.
pull_request:
branches:
- '*analysis*'
- '*sonar*'
# Allow manual kicking off of the workflow from github.com
workflow_dispatch:
# Uncomment the following line if we want to run analysis on all PRs:
# pull_request:

permissions: read-all

Expand All @@ -45,6 +51,8 @@ jobs:
# account credentials.
if: github.repository == 'AcademySoftwareFoundation/OpenImageIO'
uses: ./.github/workflows/build-steps.yml
# Must let the called steps workflow inherit our secrets
secrets: inherit
with:
nametag: ${{ matrix.nametag || 'unnamed!' }}
runner: ${{ matrix.runner || 'ubuntu-latest' }}
Expand Down Expand Up @@ -75,7 +83,7 @@ jobs:
fail-fast: false
matrix:
include:
- desc: sonar gcc9/C++14 py39 exr3.1 ocio2.2
- desc: sonar gcc11/C++17 py310 exr3.2 ocio2.3
nametag: static-analysis-sonar
os: ubuntu-latest
container: aswf/ci-osl:2024-clang17
Expand All @@ -90,7 +98,7 @@ jobs:
setenvs: export SONAR_SERVER_URL="https://sonarcloud.io"
BUILD_WRAPPER_OUT_DIR=/__w/OpenImageIO/OpenImageIO/bw_output
OIIO_CMAKE_BUILD_WRAPPER="build-wrapper-linux-x86-64 --out-dir /__w/OpenImageIO/OpenImageIO/bw_output"
CMAKE_BUILD_TYPE=Debug
OIIO_CMAKE_BUILD_TYPE=Debug
CMAKE_UNITY_BUILD=OFF
CODECOV=1
CTEST_TEST_TIMEOUT=1200
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sonar.host.url=https://sonarcloud.io
# Required metadata
sonar.organization=academysoftwarefoundation
sonar.projectName=OpenImageIO
sonar.projectVersion=2.6
sonar.projectVersion=3.1
sonar.projectKey=AcademySoftwareFoundation_OpenImageIO

# Project links
Expand Down
3 changes: 2 additions & 1 deletion src/build-scripts/ci-build.bash
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ OIIO_CMAKE_FLAGS="$MY_CMAKE_FLAGS $OIIO_CMAKE_FLAGS"
export OIIO_SRC_DIR=${OIIO_SRC_DIR:=$PWD}
export OIIO_BUILD_DIR=${OIIO_BUILD_DIR:=${OIIO_SRC_DIR}/build}
export OIIO_INSTALL_DIR=${OIIO_INSTALL_DIR:=${OIIO_SRC_DIR}/dist}
export OIIO_CMAKE_BUILD_TYPE=${OIIO_CMAKE_BUILD_TYPE:=${CMAKE_BUILD_TYPE:=Release}}

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

# pushd $OIIO_BUILD_DIR
cmake -S $OIIO_SRC_DIR -B $OIIO_BUILD_DIR -G "$CMAKE_GENERATOR" \
-DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" \
-DCMAKE_BUILD_TYPE="${OIIO_CMAKE_BUILD_TYPE}" \
-DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH" \
-DCMAKE_INSTALL_PREFIX="$OpenImageIO_ROOT" \
-DPYTHON_VERSION="$PYTHON_VERSION" \
Expand Down

0 comments on commit af252a1

Please sign in to comment.