Skip to content

Analysis

Analysis #174

# SPDX-License-Identifier: BSD-3-Clause
# Copyright Contributors to the OpenColorIO Project.
#
# GitHub Actions workflow file
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
name: Analysis
on:
pull_request:
branches-ignore:
- RB-0.*
- RB-1.*
- gh-pages
tags-ignore:
- v0.*
- v1.*
paths:
- .github/workflows/analysis_workflow.yml
schedule:
# Nightly build
- cron: "0 0 * * *"
jobs:
# ---------------------------------------------------------------------------
# SonarCloud static analysis
# ---------------------------------------------------------------------------
linux_sonarcloud:
name: 'Linux VFX CY2023 SonarCloud'
# Don't run on OCIO forks
if: github.repository == 'AcademySoftwareFoundation/OpenColorIO'
# GH-hosted VM. The build runs in ASWF 'container' defined below.
runs-on: ubuntu-latest
container:
# DockerHub: https://hub.docker.com/u/aswf
# Source: https://github.com/AcademySoftwareFoundation/aswf-docker
image: aswf/ci-ocio:2023
env:
CXX: g++
CC: gcc
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 50
- name: Install sonar-scanner and build-wrapper
uses: sonarsource/sonarcloud-github-c-cpp@v2
- name: Install docs env
run: share/ci/scripts/linux/yum/install_docs_env.sh
- name: Install tests env
run: share/ci/scripts/linux/yum/install_tests_env.sh
- name: Create build directories
run: |
mkdir _install
mkdir _build
- name: Configure
run: |
cmake ../. \
-DCMAKE_INSTALL_PREFIX=../_install \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=14 \
-DCMAKE_CXX_FLAGS="-g -O0 -fprofile-arcs -ftest-coverage" \
-DCMAKE_CXX_OUTPUT_EXTENSION_REPLACE=ON \
-DCMAKE_EXE_LINKER_FLAGS="-lgcov" \
-DOCIO_BUILD_DOCS=ON \
-DOCIO_BUILD_GPU_TESTS=OFF \
-DOCIO_INSTALL_EXT_PACKAGES=ALL \
-DOCIO_WARNING_AS_ERROR=ON \
-DPython_EXECUTABLE=$(which python)
working-directory: _build
- name: Build OCIO with build-wrapper
run: build-wrapper-linux-x86-64 --out-dir bw_output make clean all
working-directory: _build
- name: Test
run: ctest -V -C Release
working-directory: _build
- name: Generate code coverage report
run: share/ci/scripts/linux/run_gcov.sh
- name: Run sonar-scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: sonar-scanner