Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: report actions #2

Merged
merged 6 commits into from
Sep 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-fast.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/build-spack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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}}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-ultralite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/deploy-pages.yml
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmake/CeleritasAddTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
29 changes: 20 additions & 9 deletions test/corecel/math/HashUtils.test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <cstdint>
#include <cstring>
#include <limits>
#include <type_traits>

#include "celeritas_test.hh"

Expand All @@ -25,6 +26,13 @@ struct PaddedStruct
int i;
long long int lli;
};

struct UnpaddedStruct
{
int i;
int j;
};

//---------------------------------------------------------------------------//
} // namespace test
} // namespace celeritas
Expand All @@ -40,6 +48,7 @@ struct hash<celeritas::test::PaddedStruct>
return celeritas::hash_combine(s.b, s.i, s.lli);
}
};

//---------------------------------------------------------------------------//
} // namespace std

Expand Down Expand Up @@ -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>);

PaddedStruct temp;
std::memset(&temp, 0x0f, sizeof(temp));
temp.b = false;
temp.i = 0x1234567;
temp.lli = 0xabcde01234ll;
Span<PaddedStruct const, 1> s{&temp, 1};
EXPECT_EQ(std::hash<decltype(s)>{}(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<decltype(s)>{}(s));
#endif
EXPECT_NE(hash_as_bytes(s), std::hash<decltype(s)>{}(s));
}

TEST(HashSpan, unpadded_struct)
{
EXPECT_TRUE(std::has_unique_object_representations_v<UnpaddedStruct>);

static int const values[] = {0x1234567, 0x2345678};
UnpaddedStruct temp;
temp.i = values[0];
temp.j = values[1];
Span<UnpaddedStruct const, 1> s{&temp, 1};
EXPECT_EQ(std::hash<decltype(s)>{}(s), hash_as_bytes(s));
EXPECT_EQ(hash_as_bytes(s), std::hash<decltype(s)>{}(s));
}

TEST(HashSpan, reals)
Expand Down
Loading