Add spack build testing - #2232
Conversation
There was a problem hiding this comment.
Pull request overview
Adds weekly Spack build and smoke testing across Ubuntu and optional dependency configurations.
Changes:
- Adds six OS/variant build combinations.
- Runs a Poisson tutorial smoke test.
- Uploads diagnostics and reports scheduled failures through GitHub issues.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
da630f2 to
6c3b4c9
Compare
55eb07c to
ec845c5
Compare
|
There are several PRs in the spack-packages repo open which are necessary to get things running here:
Need to wait until they are merged for further testing, therefore draft mode for now. |
| ${{ github.workspace }}/spack_build_logs | ||
| retention-days: 7 | ||
|
|
||
| report-failure: |
There was a problem hiding this comment.
Should this be added? We also have this nowhere else in our testing.
I think it would make sense to create this repo wide for all test suites and therefore create a reusable action for this
There was a problem hiding this comment.
This does not to be added. Please feel free to adjust or make a suggestion how to generalize. Thanks already @davidrudlstorfer
There was a problem hiding this comment.
Something like this could work
Reusable action
name: Report nightly test failure
description: Create or update a GitHub issue when a nightly test fails
inputs:
title:
description: Title of the failure issue
required: true
body:
description: Initial body of the failure issue
required: true
labels:
description: Comma-separated list of issue labels
required: true
runs:
using: composite
steps:
- name: Create or update issue
uses: actions/github-script@v7
with:
script: |
const title = `${{ inputs.title }}`;
const body = `${{ inputs.body }}`;
const labels = `${{ inputs.labels }}`.split(",").map(label => label.trim());
const runUrl =
`${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;
const { data: existingIssues } = await github.rest.issues.listForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
state: "open",
labels: labels.join(","),
});
const existing = existingIssues.find(
(issue) => issue.title === title
);
const timestamp = new Date().toISOString();
const note = [
`- \`${timestamp}\`: failed run [#${context.runNumber}](${runUrl}) `,
`(commit ${context.sha.substring(0, 8)}, ref \`${context.ref}\`)`,
].join("");
if (existing) {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: existing.number,
body: note,
});
core.info(`Added a comment to existing issue #${existing.number}`);
} else {
const issueBody = [
body,
"",
note,
"",
"This issue is filed/updated automatically. Please close it once the underlying problem is fixed; " +
"a new one will be filed automatically if it fails again.",
].join("\n");
const created = await github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title,
body: issueBody,
labels,
});
core.info(`Filed new issue #${created.data.number}`);
}and then this workflow simplifies to
report-failure:
needs: spack-build
if: failure() && github.event_name == 'schedule'
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: ./.github/actions/report-nightly-failure
with:
title: "Scheduled Spack build test is failing"
labels: "github_actions,type: bug report"
body: |
The scheduled **Spack build test** workflow failed.
This workflow builds the latest official 4C release via the
[`4c-multiphysics` Spack package](https://packages.spack.io/package.html?name=4c-multiphysics)
across several OS/variant combinations and runs a smoke test against the result.
A failure here typically indicates one of:
- The `4c-multiphysics` Spack package (or one of its dependencies) needs to be updated for the latest 4C release.
- A regression in 4C's build system that only shows up outside of the in-repo Docker-based CI.
- A transient upstream Spack/buildcache issue.Then it should be possible to reuse this for all the other nightly workflows as well.
(AI helped writing the files, some iterations were necessary no get to a meaningful state)
Description and Context
Add weekly test of several spack build configurations for different operating system versions (currently ubuntu 24.04 and ubuntu 26.04). As a smoke test, a single test file, namely
tests/tutorials/poisson/tutorial_poisson_thermo.4C.yamlis run after the build.At the moment, only the the latest release known in the
spack_repois tested. An issue is opened if something fails.Related Issues and Pull Requests
Disclosure of AI assistance
This script was created by Claude Sonnet 5.0