Skip to content

⬆️ Bump actions/checkout from 5.0.1 to 6.0.0 in /.github/workflows #396

⬆️ Bump actions/checkout from 5.0.1 to 6.0.0 in /.github/workflows

⬆️ Bump actions/checkout from 5.0.1 to 6.0.0 in /.github/workflows #396

Workflow file for this run

name: Usage Test
permissions: read-all
on:
workflow_dispatch:
merge_group:
push:
branches:
- 'main'
- 'dev'
- 'cmake-**'
pull_request:
branches:
- 'main'
- 'dev'
- 'cmake-**'
env:
DEBIAN_FRONTEND: noninteractive
CMAKE_GENERATOR: Ninja
TARGET_LLVM_VERSION: 21
MULL_LLVM_MAJOR_VERSION: 19
MULL_LLVM_VERSION: 19.1.1
MULL_VERSION: 0.27.1
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
test:
runs-on: ${{ github.repository_owner == 'intel' && 'intel-' || '' }}ubuntu-24.04
steps:
- name: Install build tools
run: |
wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh ${{env.TARGET_LLVM_VERSION}}
sudo apt update && sudo apt install -y pip ninja-build clang-tidy-${{env.TARGET_LLVM_VERSION}} clang-format-${{env.TARGET_LLVM_VERSION}}
- name: Setup Node.js
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: 20
- name: Install Mermaid
run: |
npm install -g @mermaid-js/[email protected]
npx puppeteer browsers install chrome-headless-shell
- name: Install asciidoctor
run: |
sudo apt install -y asciidoctor
sudo gem install asciidoctor asciidoctor-diagram rouge
- name: Checkout target branch
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
ref: ${{github.base_ref}}
- name: Extract target branch SHA
run: echo "branch=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
id: target_branch
- name: Checkout PR branch
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
- name: Install python test requirements
run: |
python3 -m venv ${{github.workspace}}/test_venv
source ${{github.workspace}}/test_venv/bin/activate
pip install -r ${{github.workspace}}/requirements.txt
echo "${{github.workspace}}/test_venv/bin" >> $GITHUB_PATH
- name: Install cmake-format
run: |
pip install cmakelang pyyaml
- name: Install python quality tools
run: |
pip install mypy black
- name: Configure cmake for lib
env:
CC: "/usr/lib/llvm-${{env.TARGET_LLVM_VERSION}}/bin/clang"
CXX: "/usr/lib/llvm-${{env.TARGET_LLVM_VERSION}}/bin/clang++"
PR_TARGET_BRANCH: ${{ steps.target_branch.outputs.branch }}
working-directory: ${{github.workspace}}/test/library
run: cmake -Bbuild -DINFRA_TARGET_NAMESPACE=infra
- name: Build lib docs
working-directory: ${{github.workspace}}/test/library
run: test $(cmake --build build -v -t infra.docs | grep -c ERROR) == 0
- name: Build lib metabench tests
working-directory: ${{github.workspace}}/test/library
run: cmake --build build -t infra.metabench_tests
- name: Check lib quality
working-directory: ${{github.workspace}}/test/library
run: cmake --build build -t infra.ci-quality
- name: Restore CPM cache
env:
cache-name: cpm-cache-0
id: cpm-cache-restore
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ~/cpm-cache
key: ${{runner.os}}-${{env.cache-name}}-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }}
restore-keys: |
${{runner.os}}-${{env.cache-name}}-
- name: Configure cmake for app
env:
CC: "/usr/lib/llvm-${{env.TARGET_LLVM_VERSION}}/bin/clang"
CXX: "/usr/lib/llvm-${{env.TARGET_LLVM_VERSION}}/bin/clang++"
PR_TARGET_BRANCH: ${{ steps.target_branch.outputs.branch }}
working-directory: ${{github.workspace}}/test/application
run: cmake -Bbuild -DCPM_SOURCE_CACHE=~/cpm-cache -DINFRA_TARGET_NAMESPACE=infra
- name: Save CPM cache
env:
cache-name: cpm-cache-0
if: steps.cpm-cache-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ~/cpm-cache
key: ${{runner.os}}-${{env.cache-name}}-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }}
- name: Build app and run tests
working-directory: ${{github.workspace}}/test/application
run: |
cmake --build build -t infra.build_unit_tests
ctest --output-on-failure --test-dir build
- name: Run benchmarks
working-directory: ${{github.workspace}}/test/application
run: |
cmake --build build -t infra.benchmarks
- name: Run recipe tests
working-directory: ${{github.workspace}}/test/application
run: |
cmake --build build -t recipe_tests
- name: Generate coverage report
working-directory: ${{github.workspace}}/test/application
run: |
cmake --build build -t infra.cpp_coverage_report
echo "<details>" >> $GITHUB_STEP_SUMMARY
echo "<summary>Coverage report:</summary>" >> $GITHUB_STEP_SUMMARY
cat ./build/coverage_report.txt >> $GITHUB_STEP_SUMMARY
echo "</details>" >> $GITHUB_STEP_SUMMARY
- name: Check app quality
working-directory: ${{github.workspace}}/test/application
run: cmake --build build -t infra.ci-quality
- name: Verify app setup
working-directory: ${{github.workspace}}/test
run: ./verify_links.sh
sanitize:
runs-on: ${{ github.repository_owner == 'intel' && 'intel-' || '' }}ubuntu-24.04
strategy:
fail-fast: false
matrix:
sanitizer: [undefined, address]
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
- name: Install build tools
run: |
wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh ${{env.TARGET_LLVM_VERSION}}
sudo apt install -y ninja-build clang-tidy-${{env.TARGET_LLVM_VERSION}} clang-format-${{env.TARGET_LLVM_VERSION}}
- name: Restore CPM cache
env:
cache-name: cpm-cache-0
id: cpm-cache-restore
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ~/cpm-cache
key: ${{runner.os}}-${{env.cache-name}}-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }}
restore-keys: |
${{runner.os}}-${{env.cache-name}}-
- name: Configure cmake for app
env:
CC: "/usr/lib/llvm-${{env.TARGET_LLVM_VERSION}}/bin/clang"
CXX: "/usr/lib/llvm-${{env.TARGET_LLVM_VERSION}}/bin/clang++"
SANITIZERS: ${{matrix.sanitizer}}
working-directory: ${{github.workspace}}/test/application
run: cmake -Bbuild -DCPM_SOURCE_CACHE=~/cpm-cache -DINFRA_TARGET_NAMESPACE=infra
- name: Save CPM cache
env:
cache-name: cpm-cache-0
if: steps.cpm-cache-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ~/cpm-cache
key: ${{runner.os}}-${{env.cache-name}}-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }}
# https://github.com/actions/runner-images/issues/9524
- name: Fix kernel mmap rnd bits
# Asan in llvm 14 provided in ubuntu 22.04 is incompatible with
# high-entropy ASLR in much newer kernels that GitHub runners are
# using leading to random crashes: https://reviews.llvm.org/D148280
run: sudo sysctl vm.mmap_rnd_bits=28
- name: Build app and run tests
working-directory: ${{github.workspace}}/test/application
run: cmake --build build -t infra.cpp_tests
mutate:
runs-on: ${{ github.repository_owner == 'intel' && 'intel-' || '' }}ubuntu-24.04
steps:
- name: Install build tools
run: |
wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh ${{env.MULL_LLVM_MAJOR_VERSION}}
sudo apt install -y ninja-build
- name: Install mull
env:
mull-pkg: Mull-${{env.MULL_LLVM_MAJOR_VERSION}}-${{env.MULL_VERSION}}-LLVM-${{env.MULL_LLVM_VERSION}}-ubuntu-amd64-24.04.deb
run: |
wget https://github.com/mull-project/mull/releases/download/${{env.MULL_VERSION}}/${{env.mull-pkg}}
sudo dpkg -i ${{env.mull-pkg}}
- name: Checkout PR branch
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
- name: Restore CPM cache
env:
cache-name: cpm-cache-0
id: cpm-cache-restore
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ~/cpm-cache
key: ${{runner.os}}-${{env.cache-name}}-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }}
restore-keys: |
${{runner.os}}-${{env.cache-name}}-
- name: Configure cmake for app
env:
CC: "/usr/lib/llvm-${{env.MULL_LLVM_MAJOR_VERSION}}/bin/clang"
CXX: "/usr/lib/llvm-${{env.MULL_LLVM_MAJOR_VERSION}}/bin/clang++"
working-directory: ${{github.workspace}}/test/application
run: cmake -Bbuild -DCPM_SOURCE_CACHE=~/cpm-cache -DINFRA_TARGET_NAMESPACE=infra
- name: Save CPM cache
env:
cache-name: cpm-cache-0
if: steps.cpm-cache-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ~/cpm-cache
key: ${{runner.os}}-${{env.cache-name}}-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }}
- name: Build app and run mull tests
working-directory: ${{github.workspace}}/test/application
run: |
cmake --build build -t infra.mull_tests
merge_ok:
runs-on: ${{ github.repository_owner == 'intel' && 'intel-' || '' }}ubuntu-24.04
needs: [test, sanitize, mutate]
if: ${{ !cancelled() }}
steps:
- name: Enable merge
if: >-
${{
contains(needs.*.result, 'failure')
|| contains(needs.*.result, 'cancelled')
|| contains(needs.*.result, 'skipped')
}}
run: exit 1