Debian Codegraph @

.github/workflows/analysis_workflow.yml

raw
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright (c) Contributors to the OpenEXR Project.
3 #
4 # GitHub Actions workflow file
5 # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
6
7 name: Analysis
8
9 on:
10 schedule:
11 # Weekly Sunday build
12 - cron: "0 0 * * 0"
13 workflow_dispatch:
14
15 jobs:
16
17 # ---------------------------------------------------------------------------
18 # SonarCloud static analysis
19 # ---------------------------------------------------------------------------
20
21 linux_sonarcloud:
22 name: 'SonarCloud Linux CentOS 7 VFX CY2024 <GCC 11.2.1>'
23 # GH-hosted VM. The build runs in CentOS 7 'container' defined below.
24 runs-on: ubuntu-latest
25 container:
26 # DockerHub: https://hub.docker.com/u/aswf
27 # Source: https://github.com/AcademySoftwareFoundation/aswf-docker
28 image: aswf/ci-openexr:2024
29 env:
30 CXX: g++
31 CC: gcc
32 steps:
33 # TODO: Remove this workaround following resolution of:
34 # https://github.com/AcademySoftwareFoundation/aswf-docker/issues/43
35 - name: Setup container
36 run: sudo rm -rf /usr/local/lib64/cmake/glew
37 - name: Checkout
38 uses: actions/checkout@v3
39 with:
40 fetch-depth: 50
41 - name: Create build directories
42 run: |
43 mkdir _install
44 mkdir _build
45 - name: Configure
46 run: |
47 cmake .. \
48 -DCMAKE_INSTALL_PREFIX=../_install \
49 -DCMAKE_BUILD_TYPE=Release \
50 -DCMAKE_CXX_STANDARD=17 \
51 -DCMAKE_CXX_FLAGS="-g -O0 -fprofile-arcs -ftest-coverage" \
52 -DCMAKE_CXX_OUTPUT_EXTENSION_REPLACE=ON \
53 -DCMAKE_C_FLAGS="-g -O0 -fprofile-arcs -ftest-coverage" \
54 -DCMAKE_C_OUTPUT_EXTENSION_REPLACE=ON \
55 -DCMAKE_EXE_LINKER_FLAGS="-lgcov" \
56 -DCMAKE_VERBOSE_MAKEFILE:BOOL='OFF' \
57 -DBUILD_SHARED_LIBS='OFF' \
58 -DPYTHON='ON'
59 working-directory: _build
60 - name: Build Imath with build-wrapper
61 shell: bash
62 run: |
63 build-wrapper-linux-x86-64 --out-dir bw_output cmake --build . --target install --config Release
64 working-directory: _build
65 - name: Test
66 run: |
67 ctest -T Test \
68 -C Release \
69 --timeout 7200 \
70 --output-on-failure \
71 -VV
72 working-directory: _build
73 - name: Coverage
74 run: share/ci/scripts/linux/run_gcov.sh
75 shell: bash
76 - name: Sonar-scanner
77 env:
78 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79 SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
80 run: sonar-scanner -X
81
82 # ------------------------------------------------------------------------------
83 # Valgrind memcheck test
84 # ------------------------------------------------------------------------------
85 linux_valgrind:
86 name: 'Valgrind Linux CentOS 7 VFX CY2024 <GCC 11.2.1>'
87 # GH-hosted VM. The build runs in CentOS 7 'container' defined below.
88 runs-on: ubuntu-latest
89 container:
90 # DockerHub: https://hub.docker.com/u/aswf
91 # Source: https://github.com/AcademySoftwareFoundation/aswf-docker
92 image: aswf/ci-openexr:2024
93 env:
94 CXX: g++
95 CC: gcc
96 steps:
97 # TODO: Remove this workaround following resolution of:
98 # https://github.com/AcademySoftwareFoundation/aswf-docker/issues/43
99 - name: Setup container
100 run: sudo rm -rf /usr/local/lib64/cmake/glew
101 - name: Checkout
102 uses: actions/checkout@v3
103 with:
104 fetch-depth: 50
105 - name: Create build directories
106 run: |
107 mkdir _install
108 mkdir _build
109 shell: bash
110 - name: Install Dependencies
111 run: |
112 share/ci/scripts/linux/install_valgrind.sh
113 shell: bash
114 - name: Configure
115 run: |
116 cmake .. \
117 -DCMAKE_INSTALL_PREFIX=../_install \
118 -DCMAKE_BUILD_TYPE=Release \
119 -DCMAKE_CXX_STANDARD=17 \
120 -DCMAKE_VERBOSE_MAKEFILE:BOOL='OFF' \
121 -DBUILD_SHARED_LIBS='OFF' \
122 -DPYTHON='ON'
123 working-directory: _build
124 - name: Build
125 run: |
126 cmake --build . \
127 --target install \
128 --config Release
129 working-directory: _build
130 - name: Valgrind memcheck tests
131 run: |
132 ctest -C Release \
133 --timeout 50000 \
134 --force-new-ctest-process \
135 --test-action memcheck \
136 --output-on-failure \
137 -VV
138 working-directory: _build
139 - name: Valgrind memcheck test results
140 run: |
141 share/ci/scripts/linux/log_valgrind.sh _build
142 shell: bash
143