Skip to content

Add spack build testing - #2232

Draft
georghammerl wants to merge 4 commits into
4C-multiphysics:mainfrom
georghammerl:add_spack_build_test
Draft

Add spack build testing#2232
georghammerl wants to merge 4 commits into
4C-multiphysics:mainfrom
georghammerl:add_spack_build_test

Conversation

@georghammerl

@georghammerl georghammerl commented Aug 27, 2026

Copy link
Copy Markdown
Member

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.yaml is run after the build.

At the moment, only the the latest release known in the spack_repo is 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

@georghammerl
georghammerl requested review from ppraegla and a balanced review from Copilot August 27, 2026 14:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .github/workflows/spack.yml Outdated
Comment thread .github/workflows/spack.yml
Comment thread .github/workflows/spack.yml Outdated
Comment thread .github/workflows/spack.yml Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment thread .github/workflows/spack.yml
Comment thread .github/workflows/spack.yml

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread .github/workflows/spack.yml
@georghammerl
georghammerl marked this pull request as draft August 28, 2026 08:26
@georghammerl

georghammerl commented Aug 28, 2026

Copy link
Copy Markdown
Member Author

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.

@georghammerl georghammerl self-assigned this Aug 28, 2026
${{ github.workspace }}/spack_build_logs
retention-days: 7

report-failure:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not to be added. Please feel free to adjust or make a suggestion how to generalize. Thanks already @davidrudlstorfer

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants