Skip to content

Commit

Permalink
Merge branch 'develop' into geant4-nav
Browse files Browse the repository at this point in the history
  • Loading branch information
sethrj authored Jan 10, 2025
2 parents f86f19c + 56a2ea5 commit 7c53045
Show file tree
Hide file tree
Showing 1,771 changed files with 5,402 additions and 6,670 deletions.
9 changes: 8 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Checks: |
-cppcoreguidelines-init-variables
-cppcoreguidelines-pro-type-member-init
-cppcoreguidelines-avoid-do-while
-cppcoreguidelines-avoid-non-const-global-variables
-cppcoreguidelines-pro-type-const-cast
-cppcoreguidelines-pro-bounds-array-to-pointer-decay
-cppcoreguidelines-avoid-const-or-ref-data-members
Expand Down Expand Up @@ -47,7 +48,13 @@ CheckOptions:
cppcoreguidelines-avoid-non-const-global-variables.AllowInternalLinkage: true
performance-move-const-arg.CheckTriviallyCopyableMove: false
performance-move-const-arg.CheckMoveToConstRef: false

bugprone-reserved-identifier.AllowedIdentifiers: |
R__NO_DEPRECATION;
G__DICTIONARY;
G__ROOT;
__TheDictionaryInitializer
HeaderFileExtensions: ['hh']
ImplementationFileExtensions: ['cc']
HeaderFilterRegex: '(app|src/(accel|celeritas|corecel|orange|geocel))/.*\.hh$'
FormatStyle: file
...
1 change: 1 addition & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ c93d9582552e2d7ad4e18d9d74b7e9e62de53c0e
7a0f476ae128025a8843ba2b1e6e6284efb7d0dd
c06d0a263847884aff7aefc9280c758860ea5fc2
f27dc24aac631ebfea4f487a0d122a0e69d3c083
f7eba0148dcc1b8f284aaa63643658dbe11a9507
# clang-format and IWYU
0e14b341e12eb750b627e7d61602e50c68db2551
954cd07322312b43eb7dc926abd0054f630a8eff
Expand Down
17 changes: 15 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,30 @@ If you're a core developer, add one of each label:
- Change type: {bug, documentation, enhancement, minor}
- Category: {app, core, external, field, orange, performance, physics, user}

Some examples of labels are:
Some examples of labels corresponding to titles are:
- *Implement the FooBar model*: enhancement, physics
- *Handle errors in track initialization*: enhancement, orange
- *Fix sampling of low-energy Celeritons*: bug, physics
- *Refactor code in preparation for new tracker type*: minor, orange
- *Add CI support for multiple Geant4 versions*: enhancement, documentation

See [review process](https://github.com/celeritas-project/celeritas/blob/develop/doc/appendix/administration.rst#code-review) for descriptions of the labels and requirements.
See [review process](https://celeritas-project.github.io/celeritas/user/appendix/administration.html#code-review) for descriptions of the labels and requirements.

# Draft status

The final button to push, "Create pull request", has an drop-down menu arrow
next to it that lets you change to "Draft pull request". Select this option if
you want to run further testing before beginning the review process.

# Copyright

Copyrights and patents in the Celeritas project are retained by contributors.
No copyright assignment is required to contribute to Celeritas, but by
submitting content in this pull request, *you are confirming that you have the
right to make your contribution to Celeritas, and that if you are making your
contribution in the course of your employment, that such contributions are
authorized by your employer.*

See [the top-level COPYRIGHT file](https://github.com/celeritas-project/celeritas/blob/develop/COPYRIGHT)
for details on code copyright, or [the documentation COPYRIGHT file](https://github.com/celeritas-project/celeritas/blob/develop/doc/COPYRIGHT)
for the documentation license.
47 changes: 12 additions & 35 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,47 +24,42 @@ jobs:
special: [null]
geometry: ["orange", "vecgeom"]
buildtype: ["debug", "ndebug"]
image: ["ubuntu-cuda"] # TODO: upgrade CI images, add ["centos-rocm"]
image: ["rocky-cuda", "ubuntu-rocm"]
exclude:
- geometry: "vecgeom"
image: "centos-rocm" # VecGeom not installed on HIP
image: "ubuntu-rocm" # VecGeom not installed on HIP
- buildtype: "debug"
image: "centos-rocm" # Debug builds don't work with HIP
image: "ubuntu-rocm" # Debug builds don't work with HIP
include:
- geometry: "vecgeom"
buildtype: "reldeb"
image: "ubuntu-cuda"
image: "rocky-cuda"
env:
CELER_TEST_STRICT: 1
CELER_DISABLE_DEVICE: 1 # IMPORTANT
CELER_DISABLE_DEVICE: 1 # REQUIRED for GHA runners
CMAKE_PRESET: >-
${{format('{0}-{1}{2}{3}',
matrix.buildtype,
matrix.geometry,
matrix.special && '-' || '',
matrix.special)}}
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true # TODO: DELETEME, see #1305
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
container:
image: >-
docker.io/celeritas/${{
matrix.image == 'ubuntu-cuda' && 'ci-jammy-cuda11:2023-08-02'
|| matrix.image == 'centos-rocm' && 'ci-centos7-rocm5:2022-12-14.2'
matrix.image == 'rocky-cuda' && 'ci-rocky-cuda12:2024-12-29'
|| matrix.image == 'ubuntu-rocm' && 'ci-ubuntu-rocm6:2025-01-02'
}}
# TODO: I think this will be fixed if we upgrade checkout
# See https://github.com/actions/checkout/issues/956
options: --user root
steps:
- name: Set up environment
run: |
. /etc/profile
echo "/opt/view/bin" >> $GITHUB_PATH
echo "CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}" >> $GITHUB_ENV
# NOTE: checkout must occur *after* setting up environment for git tags to work
# NOTE: checkout v4 fails: https://github.com/actions/checkout/issues/1487
# NOTE: depth must be enough to include the previous tag
- name: Check out Celeritas
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 383
fetch-tags: true
Expand All @@ -77,21 +72,10 @@ jobs:
working-directory: build
run: |
ninja
- name: Regenerate ROOT test data
working-directory: build
# NOTE: we have to do this for now because the ROOT version on the CI image is too old:
# see https://github.com/root-project/root/pull/12845
# Revert when we update the CI images
run: |
if [ -e test ]; then
ninja -v -k0 update-root-test-data
fi
- name: Test Celeritas
id: test
working-directory: build
run: |
ctest --parallel $(nproc) --timeout 180 --output-on-failure \
--test-output-size-passed=65536 --test-output-size-failed=1048576
ctest --preset=base
- name: Install Celeritas
working-directory: build
run: |
Expand All @@ -108,26 +92,19 @@ jobs:
# TODO: rocm+ndebug fails to propagate HIP library link
if: >-
${{
!(matrix.image == 'centos-rocm' && matrix.buildtype == 'ndebug')
!(matrix.image == 'ubuntu-rocm' && matrix.buildtype == 'ndebug')
}}
run: |
. /etc/profile
if [ "${{matrix.geometry}}" = "vecgeom" ]; then
# TODO: vecgeom is loosey goosey about symbols whereas Ubuntu is strict
export LDFLAGS=-Wl,--no-as-needed ${LDFLAGS}
fi
./scripts/ci/test-examples.sh
- name: Upload test results
# Note: upload-v3 doesn't seem to pick up the paths: delete the "false" line below once we
# upgrade the centos/ubuntu docker images
if: >-
${{
false &&
always()
&& (steps.test.outcome == 'success'
|| steps.test.outcome == 'failure')
}}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: test-results-${{matrix.image}}-${{env.CMAKE_PRESET}}
path: "test-output/**/*.xml"
Expand Down
55 changes: 40 additions & 15 deletions .github/workflows/build-spack.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Build directly on the GitHub runner with caching
# NOTE: sync spack versions with https://github.com/celeritas-project/spack-gha-buildcache
# - Spack version
# - Any required spack patches
# - Github runner versions
# - Environment versions at scripts/ci/spack.yaml
name: build-spack
on:
workflow_dispatch:
Expand All @@ -8,7 +13,7 @@ concurrency:
group: build-spack-${{github.ref}}-${{github.event.pull_request.number || github.run_number}}-${{github.workflow}}

env:
SPACK_REF: 5fe93fee1eec46a0750bd340198bffcb92ff9eec # v0.22.0
SPACK_REF: 866785bd74964142e4b47bf71bee68d7426c84ee # develop@2024-12-31

jobs:
spack:
Expand All @@ -24,7 +29,7 @@ jobs:
matrix:
geometry: ["vecgeom"]
special: [null]
geant: ["10.5", "10.6", "10.7", "11.0", "11.1", "11.2"]
geant: ["10.5", "10.6", "10.7", "11.0", "11.1", "11.2", "11.3"]
include:
- geometry: "orange"
special: "minimal"
Expand Down Expand Up @@ -54,10 +59,12 @@ jobs:
matrix.special)}}
SPACK_VIEW: "/opt/spack-view"
SPACK_BUILDCACHE: "celer-buildcache" # see spack.yaml
CC: "clang-15"
CXX: "clang++-15"
CLANG_TIDY: "clang-tidy-15"
runs-on: ubuntu-22.04
CC: "clang-18"
CXX: "clang++-18"
CLANG_TIDY: "clang-tidy-18"
CXXSTD: ${{(matrix.geant == '10.5' || matrix.geant == '10.6')
&& 17 || 20}}
runs-on: ubuntu-24.04
continue-on-error: false
steps:
- name: Check out Celeritas
Expand All @@ -66,28 +73,35 @@ jobs:
fetch-depth: ${{format('{0}', matrix.special != 'clang-tidy' && 383 || 0)}}
fetch-tags: true # to get version information
- name: Setup Spack
uses: spack/setup-spack@0ce61628ed8a32a5664cf01a0e0b5a4834a3b413 # 2024/03
uses: spack/setup-spack@5792f7c7055c3707819380b5e3831d2be6e64b6c # 2024/12
with:
ref: ${{env.SPACK_REF}}
buildcache: true
color: true
path: spack-src
- name: Patch spack # To be deleted; see associated github pulls
working-directory: spack-src
run: |
curl -LfsS https://github.com/spack/spack/pull/48328.diff | patch -p1
curl -LfsS https://github.com/spack/spack/pull/48332.diff | patch -p1
curl -LfsS https://github.com/spack/spack/pull/48347.diff | patch -p1
- name: Initialize spack environment
run: |
# TODO: https://github.com/spack/spack/pull/43136
curl -LfsS https://github.com/spack/spack/pull/43136.patch | git -C spack-src apply -
cp scripts/ci/spack.yaml .
sed -e 's/cxxstd=default/cxxstd=${{env.CXXSTD}}/' \
scripts/ci/spack.yaml > spack.yaml
if [ "${{matrix.geometry}}" == "vecgeom" ]; then
spack -e . add vecgeom
spack -e . add vecgeom+gdml
fi
if [ "${{matrix.special}}" != "minimal" ] && [ "${{matrix.special}}" != "asanlite" ] ; then
if ${{(matrix.special != 'minimal'
&& matrix.special != 'asanlite'
&& env.CXXSTD == '20')
&& 'true' || 'false'}}; then
spack -e . add root
fi
if [ "${{matrix.geant}}" != "" ]; then
spack -e . add geant4@${{matrix.geant}}
fi
spack -e . config add packages:all:require:"'%clang@15 target=x86_64_v3'"
spack -e . compiler find
spack -vd -e . compiler find --mixed-toolchain
# Add the spack ref so that updating spack will reconcretize
echo "# Concretized with ${{env.SPACK_REF}}" >> spack.yaml
- name: Cache concretization
Expand All @@ -105,8 +119,11 @@ jobs:
spack -e . env depfile -o Makefile
make -Orecurse -j $(($(nproc) + 1)) SPACK_INSTALL_FLAGS=--no-check-signature
- name: Save Spack installation to build cache
env:
GITHUB_ACTOR: ${{github.actor}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
spack -e . mirror set --push --oci-username ${{github.actor}} --oci-password "${{secrets.GITHUB_TOKEN}}" ${SPACK_BUILDCACHE}
spack -e . mirror set --push --oci-username-variable GITHUB_ACTOR --oci-password-variable GITHUB_TOKEN ${SPACK_BUILDCACHE}
spack -e . buildcache push -j $(($(nproc) + 1)) --base-image ubuntu:22.04 --unsigned --update-index ${SPACK_BUILDCACHE}
if: ${{github.event_name == 'push' && !cancelled()}}
- name: Activate environment
Expand Down Expand Up @@ -150,6 +167,14 @@ jobs:
ALL_FILES=$(git diff --name-only --diff-filter=ACM "$BASE" HEAD)
set +e
CC_FILES=$(grep -E '^(src|app)/.*\.cc$' - <<< "$ALL_FILES")
# Get list of files from compile_commands.json and filter CC_FILES
COMPILED_FILES=$(jq -r '.[].file' build/compile_commands.json)
CC_FILES=$(echo "$CC_FILES" | while read -r file; do
if echo "$COMPILED_FILES" | grep -qE "^.*/${file}$"; then
echo "$file"
fi
done)
set -e
if [ -z "$CC_FILES" ]; then
echo "No files to run clang-tidy on."
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-ultralite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ jobs:
CCACHE_DIR: "${{github.workspace}}/.ccache"
CCACHE_MAXSIZE: "50Mi"
CMAKE_PRESET: ultralite
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Install dependencies
run: |
sudo apt-get -q -y update
sudo apt-get -q -y install \
ccache cmake ninja-build nlohmann-json3-dev
ccache cmake ninja-build nlohmann-json3-dev libpng-dev
- name: Check out Celeritas
uses: actions/checkout@v4
- name: Cache ccache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/clear-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
clear-cache:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Clear ccache
uses: actions/github-script@v7
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cron_weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- build-fast
- build-spack
- build-ultralite
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Check that all jobs succeeded
uses: re-actors/alls-green@release/v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
build-docs:
uses: ./.github/workflows/doc.yml
build-site:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs: build-docs
steps:
- uses: actions/setup-python@v5
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
deploy:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs: build-site
permissions:
contents: read
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
env:
CELER_TARGET: doxygen
CELER_UPLOAD_DIR: build/doc/doxygen-html
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Install dependencies
run: |
Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
retention-days: 1 # developer docs can be large

user:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
env:
CELER_TARGET: doc
CELER_UPLOAD_DIR: build/doc/html
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/merge_group.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
needs:
- build-docker
- build-spack
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ concurrency:
jobs:
metadata:
name: "Save job metadata"
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
# Event file is needed for EnricoMi/publish-unit-test-result-action
- name: Upload event file
Expand All @@ -40,7 +40,7 @@ jobs:
uses: ./.github/workflows/doc.yml
all-prechecks:
needs: [build-fast, build-ultralite, doc]
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Success
run: "true"
Expand All @@ -59,7 +59,7 @@ jobs:
needs:
- build-docker
- build-spack
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
Expand Down
Loading

0 comments on commit 7c53045

Please sign in to comment.