diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index e483eb7e2c..32927cdda7 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -5,7 +5,7 @@ on: concurrency: group: build-${{github.ref}}-${{github.event.pull_request.number || github.run_number}}-${{github.workflow}} - cancel-in-progress: false + cancel-in-progress: true jobs: # TODO: this currently includes non-GPU builds as well @@ -119,8 +119,11 @@ jobs: 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 image if: >- ${{ + false && always() && (steps.test.outcome == 'success' || steps.test.outcome == 'failure') diff --git a/.github/workflows/build-fast.yml b/.github/workflows/build-fast.yml index ccc9062fd1..74ccbda8ac 100644 --- a/.github/workflows/build-fast.yml +++ b/.github/workflows/build-fast.yml @@ -6,7 +6,7 @@ on: concurrency: group: build-fast-${{github.ref}}-${{github.event.pull_request.number || github.run_number}}-${{github.workflow}} - cancel-in-progress: false + cancel-in-progress: true jobs: linux: diff --git a/.github/workflows/build-spack.yml b/.github/workflows/build-spack.yml index abf4371ad5..0d519d86b8 100644 --- a/.github/workflows/build-spack.yml +++ b/.github/workflows/build-spack.yml @@ -156,7 +156,9 @@ jobs: ctest -LE app --preset=spack-unit - name: Run app tests id: apptest - if: ${{!cancelled() && steps.build.outcome == 'success'}} + if: ${{!cancelled() + && matrix.special != 'clang-tidy' + && steps.build.outcome == 'success'}} continue-on-error: ${{matrix.geant == '10.6'}} # TODO: rogue output from G4DeexPrecoParameters env: CTEST_OUTPUT: "${{github.workspace}}/test-output/ctest/all.xml" @@ -167,9 +169,9 @@ jobs: if: >- ${{ always() - && !(fromJSON(matrix.geant || '0') < 11) && (steps.unittest.outcome == 'success' || steps.unittest.outcome == 'failure') + && (!matrix.geant || fromJSON(matrix.geant) >= 11) }} with: name: test-results-spack-${{env.CMAKE_PRESET}}-${{matrix.geant}} diff --git a/.github/workflows/build-ultralite.yml b/.github/workflows/build-ultralite.yml index 6df0a51a2c..ea073b5996 100644 --- a/.github/workflows/build-ultralite.yml +++ b/.github/workflows/build-ultralite.yml @@ -6,7 +6,7 @@ on: concurrency: group: build-ultralite-${{github.ref}}-${{github.event.pull_request.number || github.run_number}}-${{github.workflow}} - cancel-in-progress: false + cancel-in-progress: true jobs: linux: diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml index 1e9ac651b2..8cd9de8b91 100644 --- a/.github/workflows/deploy-pages.yml +++ b/.github/workflows/deploy-pages.yml @@ -1,5 +1,8 @@ name: deploy-pages on: + push: + branches: + - develop workflow_dispatch: # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 864816569d..8c1dc62a95 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -19,13 +19,14 @@ on: concurrency: group: pr-${{github.ref}}-${{github.event.number}}-${{github.workflow}} - cancel-in-progress: false + cancel-in-progress: true jobs: metadata: name: "Save job metadata" runs-on: ubuntu-latest steps: + # Event file is needed for EnricoMi/publish-unit-test-result-action - name: Upload event file uses: actions/upload-artifact@v4 with: @@ -35,22 +36,25 @@ jobs: uses: ./.github/workflows/build-fast.yml build-ultralite: uses: ./.github/workflows/build-ultralite.yml + doc: + uses: ./.github/workflows/doc.yml all-prechecks: - needs: [build-fast, build-ultralite] + needs: [build-fast, build-ultralite, doc] runs-on: ubuntu-latest steps: - name: Success run: "true" build-docker: + needs: [all-prechecks] uses: ./.github/workflows/build-docker.yml build-spack: + needs: [all-prechecks] uses: ./.github/workflows/build-spack.yml # Specifying a dependent job allows us to select a single "requires" check in the project GitHub settings all: if: ${{always()}} needs: - - all-prechecks - build-docker - build-spack runs-on: ubuntu-latest diff --git a/cmake/CeleritasAddTest.cmake b/cmake/CeleritasAddTest.cmake index eea44f134f..27722daced 100644 --- a/cmake/CeleritasAddTest.cmake +++ b/cmake/CeleritasAddTest.cmake @@ -15,7 +15,7 @@ Commands .. command:: celeritas_setup_tests Set dependencies for the python tests in the current CMakeLists file, - always resetting the num_process option (see the Variables + always resetting the num_process option (see the Variables section below) but leaving the link/dependency options in place. celeritas_setup_tests( diff --git a/test/corecel/math/HashUtils.test.cc b/test/corecel/math/HashUtils.test.cc index edc30b4c08..6be4234c55 100644 --- a/test/corecel/math/HashUtils.test.cc +++ b/test/corecel/math/HashUtils.test.cc @@ -11,6 +11,7 @@ #include #include #include +#include #include "celeritas_test.hh" @@ -25,6 +26,13 @@ struct PaddedStruct int i; long long int lli; }; + +struct UnpaddedStruct +{ + int i; + int j; +}; + //---------------------------------------------------------------------------// } // namespace test } // namespace celeritas @@ -40,6 +48,7 @@ struct hash return celeritas::hash_combine(s.b, s.i, s.lli); } }; + //---------------------------------------------------------------------------// } // namespace std @@ -93,32 +102,34 @@ TEST(HashUtilsTest, hash_combine) } //---------------------------------------------------------------------------// -struct UnpaddedStruct -{ - int i; - int j; -}; - TEST(HashSpan, padded_struct) { + EXPECT_FALSE(std::has_unique_object_representations_v); + PaddedStruct temp; std::memset(&temp, 0x0f, sizeof(temp)); temp.b = false; temp.i = 0x1234567; temp.lli = 0xabcde01234ll; Span s{&temp, 1}; - EXPECT_EQ(std::hash{}(s), - hash_combine(hash_combine(temp.b, temp.i, temp.lli))); +#ifndef _MSC_VER + // For reasons not clear, MSVC fails this test + EXPECT_EQ(hash_combine(hash_combine(temp.b, temp.i, temp.lli)), + std::hash{}(s)); +#endif + EXPECT_NE(hash_as_bytes(s), std::hash{}(s)); } TEST(HashSpan, unpadded_struct) { + EXPECT_TRUE(std::has_unique_object_representations_v); + static int const values[] = {0x1234567, 0x2345678}; UnpaddedStruct temp; temp.i = values[0]; temp.j = values[1]; Span s{&temp, 1}; - EXPECT_EQ(std::hash{}(s), hash_as_bytes(s)); + EXPECT_EQ(hash_as_bytes(s), std::hash{}(s)); } TEST(HashSpan, reals)