forked from celeritas-project/celeritas
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub actions to CI (celeritas-project#1020)
* Don't default CMake presets to "debug" * Rename CI presets * Use CMake BUILD_TESTING to decide to add testing tree This allows more granularity for building unit tests or just testing the apps * First iteration of GHA CI * Integrate style workflow * Try again * Fix things, thanks vscode * Fix exclusion * Disable clang-format, try different docker url * REVERTME: single job * Run as root see actions/checkout#956 ``` Post job cleanup. /usr/bin/docker exec 8a93ca44215e080743610d80ccea33c624f5d3fce1aa4038cd018c06b13a75a6 sh -c "cat /etc/*release | grep ^ID" node:internal/fs/utils:347 throw err; ^ Error: EACCES: permission denied, open '/__w/_temp/_runner_file_commands/save_state_56877b46-0efb-448b-8122-6d4d35217f1e' at Object.openSync (node:fs:590:3) at Object.writeFileSync (node:fs:2202:35) at Object.appendFileSync (node:fs:2264:6) at Object.issueFileCommand (/__w/_actions/actions/checkout/v3/dist/index.js:2950:8) at Object.saveState (/__w/_actions/actions/checkout/v3/dist/index.js:2867:31) at Object.8647 (/__w/_actions/actions/checkout/v3/dist/index.js:2326:10) at __nccwpck_require__ (/__w/_actions/actions/checkout/v3/dist/index.js:18256:43) at Object.2565 (/__w/_actions/actions/checkout/v3/dist/index.js:146:34) at __nccwpck_require__ (/__w/_actions/actions/checkout/v3/dist/index.js:18256:43) at Object.9210 (/__w/_actions/actions/checkout/v3/dist/index.js:1141:36) { errno: -13, syscall: 'open', code: 'EACCES', path: '/__w/_temp/_runner_file_commands/save_state_56877b46-0efb-448b-8122-6d4d35217f1e' } ``` * Introspect * Try a different shell * Source the fucking profile perhaps since it might ignore entrypoint * No source I guess * use github env, run tests * Try to fix environment * Try again * Fix (I think?) openmp variables for celer-sim app * Disable GPU tests at configure time if CELER_DISABLE_DEVICE * Automatically skip device tests if CELER_DISABLE_DEVICE * Update versions * Use std allocateor rather than pinned when no device is available * Use MPI max numprocs when setting NP default github runner only has 2 * Disable more tests when GPU unavailable * fixup! Use std allocateor rather than pinned when no device is available * Enable all jobs * Support root disabling (and initialization) from error handler * Disable device tests if device is disabled at runtime * Fix thread count for celer-sim with ROOT * REVERTME: disable all but one ROCM image * Downgrade to checkout v3 * Fix rocm json and jenkins build names * Fix root/shared options * fixup! Disable device tests if device is disabled at runtime * Fix json * Dubious ownership * Fix CELERITAS_TEST_VERBOSE * Fix matrix and tag fetch * Try fetch depth * Try single fetch depth, and fix use of accel example * Try more fetch depth * Add ld flags * Disable example builds that don't currently work * Fix syntax errors * Add vecgeom-reldb and fix asan diabling * Disable reldeb example too * Remove to-dos * Exclude changes to rst/md in check * REVERTME: don't disable device * Revert "REVERTME: don't disable device" This reverts commit fbdea2d. * Update 'special' annotations * Add conflict between hip+assertions and update CI matrix * Remove profile source and update working dirs * Update documentation * Fix image selection and parallelism * fixup! Fix image selection and parallelism * Reverse ordering so fine-grained is first
- Loading branch information
Showing
42 changed files
with
553 additions
and
549 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
name: ci | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
- backports/** | ||
pull_request: | ||
branches: | ||
- develop | ||
- backports/** | ||
paths-ignore: | ||
- '**.rst' | ||
- '**.md' | ||
- 'scripts/dev' | ||
merge_group: | ||
types: [checks_requested] | ||
|
||
concurrency: | ||
group: ${{github.ref}}-${{github.event.pull_request.number || github.run_number}}-${{github.workflow}} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
name: CI | ||
strategy: | ||
matrix: | ||
special: [null] | ||
geometry: ['orange', 'vecgeom'] | ||
buildtype: ['debug', 'ndebug'] | ||
image: ['ubuntu-cuda', 'centos-rocm'] | ||
exclude: | ||
- geometry: 'vecgeom' | ||
image: 'centos-rocm' # VecGeom not installed on HIP | ||
- buildtype: 'debug' | ||
image: 'centos-rocm' # Debug builds don't work with HIP | ||
include: | ||
- special: 'asan' | ||
geometry: 'orange' | ||
buildtype: 'reldeb' | ||
image: 'centos-rocm' | ||
- special: 'minimal' | ||
geometry: 'orange' | ||
buildtype: 'debug' | ||
image: 'centos-rocm' | ||
- special: 'float' | ||
geometry: 'orange' | ||
buildtype: 'debug' | ||
image: 'centos-rocm' | ||
- special: 'float' | ||
geometry: 'orange' | ||
buildtype: 'ndebug' | ||
image: 'centos-rocm' | ||
- geometry: 'geant4' | ||
buildtype: 'reldeb' | ||
image: 'centos-rocm' | ||
- geometry: 'vecgeom' | ||
buildtype: 'reldeb' | ||
image: 'ubuntu-cuda' | ||
env: | ||
ASAN_OPTIONS: "detect_leaks=0" | ||
# CCACHE_DIR: "${{github.workspace}}/.ccache" | ||
# CCACHE_MAXSIZE: "10G" | ||
CELER_TEST_STRICT: 1 | ||
CELER_DISABLE_DEVICE: 1 # IMPORTANT | ||
CMAKE_PRESET: >- | ||
${{matrix.buildtype}}-${{matrix.geometry}}${{matrix.special && '-' || ''}}${{matrix.special}} | ||
runs-on: ubuntu-latest | ||
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' | ||
|| null | ||
}} | ||
# 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 | ||
with: | ||
fetch-depth: 255 | ||
fetch-tags: true | ||
- name: Configure Celeritas | ||
run: | | ||
git config --global --add safe.directory ${PWD} | ||
ln -fs scripts/cmake-presets/ci-${{matrix.image}}.json CMakeUserPresets.json | ||
cmake --preset=${CMAKE_PRESET} | ||
- name: Build Celeritas | ||
working-directory: build | ||
run: | | ||
ninja | ||
- name: Test Celeritas | ||
working-directory: build | ||
run: | | ||
ctest --parallel 2 --timeout 180 --output-on-failure \ | ||
--test-output-size-passed=65536 --test-output-size-failed=1048576 | ||
- name: Install Celeritas | ||
working-directory: build | ||
run: | | ||
cmake --install . | ||
- name: Check installation | ||
working-directory: install | ||
run: | | ||
for exe in orange-update celer-export-geant celer-dump-data \ | ||
celer-sim celer-g4; do | ||
test -x "bin/${exe}" | ||
done | ||
./bin/celer-sim --version | ||
- name: Build examples | ||
# TODO: asan needs -fsanitize=address | ||
# TODO: rocm+ndebug fails to propagate HIP library link | ||
# TODO: logger gets initialized in SimpleOffload::Build before run manager | ||
if: >- | ||
${{ matrix.special != 'asan' | ||
&& !(matrix.image == 'centos-rocm' && matrix.buildtype == 'ndebug') | ||
&& !(matrix.geometry == 'vecgeom' && matrix.buildtype != 'ndebug') | ||
}} | ||
run: | | ||
if [ "${{matrix.geometry}}" = "vecgeom" ]; then | ||
# TODO: vecgeom is loosey goosey about symbols whereas Ubuntu is strict | ||
export LDFLAGS=-Wl,--no-as-needed | ||
fi | ||
./scripts/ci/test-examples.sh | ||
# vim: set nowrap tw=100: |
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
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
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
Oops, something went wrong.