Skip to content

refactor: Material designator with less boilerplate #33930

refactor: Material designator with less boilerplate

refactor: Material designator with less boilerplate #33930

Workflow file for this run

name: Analysis
on:
push:
branches:
- main
pull_request:
branches:
- main
- 'release/**'
- 'develop/**'
paths-ignore:
- "docs/**"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
CTEST_OUTPUT_ON_FAILURE: 1
CCACHE_DIR: ${{ github.workspace }}/ccache
CCACHE_MAXSIZE: 1.25G
CCACHE_KEY_SUFFIX: r2
ACTS_LOG_FAILURE_THRESHOLD: WARNING
# NOTE this only builds core unittests to reduce the output size. if we
# found a way to have Github actions not fail regularly with this job
# all unit tests should be reactivated.
jobs:
build_debug:
runs-on: ubuntu-latest
container: ghcr.io/acts-project/ubuntu2404:83
steps:
- uses: actions/checkout@v6
- name: Install dependencies
uses: ./.github/actions/dependencies
with:
compiler: g++
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
env_file: .env
- name: Save PR metadata
if: github.event_name == 'pull_request'
run: |
# Shallow clone: parent commits aren't available via git,
# but GitHub provides the SHAs through the event context.
printf '{"pr_number":"%s","pr_sha":"%s","base_sha":"%s","merge_sha":"%s"}\n' \
"${{ github.event.number }}" \
"${{ github.event.pull_request.head.sha }}" \
"${{ github.event.pull_request.base.sha }}" \
"${{ github.sha }}" \
> PR_metadata.json
cat PR_metadata.json
- name: Persist PR metadata
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v7
with:
name: PR_metadata
path: PR_metadata.json
- name: Cache build
uses: actions/cache@v5
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ runner.os }}-${{ github.job }}-${{ env.CCACHE_KEY_SUFFIX }}-${{ github.sha }}
restore-keys: |
ccache-${{ runner.os }}-${{ github.job }}-${{ env.CCACHE_KEY_SUFFIX }}-
- name: Configure
run: >
ccache -z &&
CI/dependencies/run.sh .env
cmake -B build -S . --preset=github-ci-coverage
- name: Build
run: cmake --build build
- name: ccache stats
run: ccache -s
- name: Unit tests
run: ctest --test-dir build -j$(nproc)
- name: Remove .o files
run: >
du -sh build
&& find build -name *.o -delete
&& du -sh build
- name: Coverage
run: |
uv run --no-project CI/test_coverage.py build --filter
- uses: actions/upload-artifact@v7
if: always()
with:
name: coverage-build
path: |
build/compile_commands.json
build/coverage/cov.xml
- uses: actions/upload-artifact@v7
if: always()
id: artifact-upload-step
with:
name: coverage-html
path: build/coverage/html
- name: Coverage display
run: |
base_link='https://acts-herald.app.cern.ch/view/${{ github.repository }}/${{ steps.artifact-upload-step.outputs.artifact-id }}'
link="$base_link/index.html"
echo "🛡️ Code coverage available at: $link"
echo "**🛡️ Code coverage available [here]($link)**" >> $GITHUB_STEP_SUMMARY
clang_tidy:
runs-on: ubuntu-latest
container: ghcr.io/acts-project/ubuntu2404_clang19:83
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Mark workspace as safe
run: git config --global --add safe.directory /__w/acts/acts
- name: Fetch base branch
if: github.event_name == 'pull_request'
run: git fetch origin "${{ github.base_ref }}"
- uses: astral-sh/setup-uv@v7
- name: Install clang-tidy
run: |
apt-get update && apt-get install -y clang-tidy-19
ln -sf /usr/bin/clang-tidy-19 /usr/bin/clang-tidy
ln -sf /usr/bin/clang++-19 /usr/bin/clang++
ln -sf /usr/bin/clang-19 /usr/bin/clang
- name: Install dependencies
uses: ./.github/actions/dependencies
with:
compiler: clang++
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
env_file: .env
- name: Configure
run: >
ccache -z &&
CI/dependencies/run.sh .env
cmake -B build -S .
--preset=gitlab-ci-clangtidy
- name: Run codegen
run: cmake --build build --target ActsCodegen
- name: Analyze (PR - changed files only)
if: github.event_name == 'pull_request'
run: >
uv run CI/clang_tidy/run_clang_tidy_pr.py
analyze build fixes.yml --base-ref "origin/${{ github.base_ref }}"
- name: Analyze (push - all files)
if: github.event_name == 'push'
run: >
uv run CI/clang_tidy/run_clang_tidy_pr.py
analyze build fixes.yml --all
- name: Upload fixes
if: always()
uses: actions/upload-artifact@v7
with:
name: clang-tidy-fixes
path: fixes.yml
- name: Annotate
run: >
uv run CI/clang_tidy/run_clang_tidy_pr.py
annotate fixes.yml