Bump ossf/scorecard-action from 2.4.0 to 2.4.1 #180
Workflow file for this run
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 2025 Torsten Knodt | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http: //www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
name: C++ CI | |
on: | |
push: | |
# branches: Disabled Because of #25 | |
# - "*" Disabled Because of #25 | |
tags: | |
- "*" | |
pull_request: | |
branches: | |
- "*" | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref || github.run_id}} | |
cancel-in-progress: true | |
permissions: {} | |
jobs: | |
build: | |
permissions: | |
actions: read | |
checks: write | |
contents: read | |
packages: write | |
# pages: write | |
pull-requests: write # Needed for test results comments | |
security-events: write | |
strategy: | |
matrix: | |
CMAKE_C_COMPILER: | |
- x86_64-linux-gnu-gcc-14 | |
- clang-18 | |
include: | |
- CMAKE_C_COMPILER: x86_64-linux-gnu-gcc-14 | |
CMAKE_CXX_COMPILER: x86_64-linux-gnu-g++-14 | |
GCOV_EXECUTABLE: x86_64-linux-gnu-gcov-14 | |
CMAKE_CXX_COMPILER_OFFLOAD: | |
- default | |
- disable | |
- CMAKE_C_COMPILER: clang-18 | |
CMAKE_CXX_COMPILER: clang++-18 | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e | |
with: | |
egress-policy: block | |
allowed-endpoints: > | |
github.com:443 | |
api.github.com:443 | |
objects.githubusercontent.com:443 | |
- name: Checkout code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
- name: Set up apt cache | |
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 | |
with: | |
path: | | |
/var/lib/apt/lists | |
/var/lib/apt/swcatalog | |
/var/cache/apt | |
key: ${{ runner.os }}-apt-${{ hashFiles('.github/workflows/ci.yml') }} | |
- name: Cache APT Packages | |
uses: torsknod2/cache-apt-pkgs-action@17ab10b5acb112df5c8f8fe83a91a4d5019eb41d # FallBack2InstallAndCachePkgIfRestorePkgFails | |
with: | |
packages: clang-18-doc clang-18-examples clang-format-18 clang-tidy-18 clangd-18 cpp-14-doc dia dia-shapes doxygen doxygen-doc doxygen-gui doxygen-latex fonts-freefont-ttf fonts-freefont-otf fonts-texgyre fonts-urw-base35 g++-14 gcc-14-doc gcc-14-locales gcc-14-multilib gcc-14-offload-amdgcn gcc-14-offload-nvptx gcovr graphviz graphviz-doc gsfonts lcov llvm-18-doc llvm-18-examples llvm-18-tools mmv mscgen nsight-compute nsight-systems nvidia-cuda-gdb nvidia-cuda-toolkit nvidia-cuda-toolkit-doc nvidia-profiler wasi-libc | |
execute_install_scripts: true | |
- name: get-cmake | |
uses: lukka/get-cmake@5f6e04f5267c8133f1273bf2103583fc72c46b17 | |
with: | |
cmakeVersion: latest | |
ninjaVersion: latest | |
useCloudCache: true | |
useLocalCache: true | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0 | |
if: success() || failure() | |
with: | |
languages: c-cpp # TODO Get (experimenta-l)actions working | |
build-mode: manual | |
queries: security-extended,security-and-quality | |
- name: Configure CMake | |
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER:FILEPATH=/usr/bin/${{matrix.CMAKE_C_COMPILER}} -DCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/${{matrix.CMAKE_CXX_COMPILER}} ${{ matrix.CMAKE_CXX_COMPILER_OFFLOAD && format('-DCMAKE_CXX_COMPILER_OFFLOAD:STRING={0}', matrix.CMAKE_CXX_COMPILER_OFFLOAD) || '' }} | |
- name: Build | |
run: cmake --build build --verbose --parallel | |
- name: Run Tests | |
working-directory: build | |
run: ctest --output-on-failure --output-log ctest.log.txt --output-junit ctest.junit.xml -j -R MDSpanTest | |
- name: Move Test Results to Target Location | |
if: success() || failure() | |
working-directory: build | |
run: | | |
find GTestOutputDir -type d -exec mmv -r "{}/*.xml" "#1.junit.xml" \; | |
mv ctest.log.txt ctest.junit.xml GTestOutputDir | |
- name: Check Test Coverage | |
uses: torsknod2/gcovr-action@742bc7c9ccf227bad1f53c59a8d5c42c79ed2b81 | |
if: (success() || failure()) && ${{matrix.GCOV_EXECUTABLE}} | |
with: | |
force_install: true | |
root: .. | |
gcov-executable: ${{matrix.GCOV_EXECUTABLE}} | |
working-directory: build | |
filter: _deps | |
fail-under-line: 100 | |
fail-under-branch: 100 | |
fail-under-decision: 100 | |
fail-under-function: 100 | |
decisions: true | |
calls: true | |
j: true | |
cobertura-out: GTestOutputDir/coverage.cobertura.xml | |
cobertura-pretty: true | |
html-out: GTestOutputDir/coverage.html | |
html-details: true | |
jacoco-out: GTestOutputDir/coverage.jacoco.xml | |
json-out: GTestOutputDir/coverage.json | |
json-pretty: true | |
json-summary-out: GTestOutputDir/coverage.summary.json | |
json-summary-pretty: true | |
lcov-out: GTestOutputDir/coverage.lcov | |
sonarqube-out: GTestOutputDir/coverage.sonarqube | |
txt-out: GTestOutputDir/coverage.txt | |
print-summary: true | |
# TODO Add test step for benchmark using RelWithDebInfo once implemented: ./BenchmarkMain | |
- name: Perform CodeQL Analysis | |
if: success() || failure() | |
uses: github/codeql-action/analyze@9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0 | |
continue-on-error: true | |
with: | |
category: "/language:c-cpp" | |
- name: Convert JUnit to HTML | |
uses: mikepenz/action-junit-report@ee6b445351cd81e2f73a16a0e52d598aeac2197f | |
if: success() || failure() | |
with: | |
comment: true | |
report_paths: build/GTestOutputDir/**/*.junit.xml | |
fail_on_failure: true | |
include_passed: true | |
- name: Test Report | |
uses: dorny/test-reporter@31a54ee7ebcacc03a09ea97a7e5465a47b84aea5 | |
if: success() || failure() | |
with: | |
name: Test Results | |
working-directory: build | |
path: GTestOutputDir/**/*.junit.xml | |
reporter: java-junit | |
- name: Upload reports/ results | |
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 | |
if: success() || failure() | |
with: | |
name: ${{ matrix.CMAKE_C_COMPILER }}-${{ matrix.CMAKE_CXX_COMPILER }}-${{ matrix.GCOV_EXECUTABLE || 'nocov' }}-${{ matrix.CMAKE_CXX_COMPILER_OFFLOAD || 'nooffload' }} | |
path: build/GTestOutputDir | |
# - name: Upload GitHub Pages Artifact | |
# uses: actions/upload-pages-artifact@v3 | |
# with: | |
# path: build/GTestOutputDir | |
# - name: Deploy to GitHub Pages | |
# if: github.ref == 'refs/heads/main' | |
# uses: actions/deploy-pages@v4 |