From 30210ff3e60d5cd6103f9ae66e2d21911b0376ed Mon Sep 17 00:00:00 2001 From: Stefan Possanner Date: Mon, 24 Nov 2025 21:43:19 +0100 Subject: [PATCH 01/12] use setup-python instead of creating venv --- .github/actions/install/install-struphy/action.yml | 2 -- .github/workflows/test-PR-pure-python.yml | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/actions/install/install-struphy/action.yml b/.github/actions/install/install-struphy/action.yml index ab2148a94..fc16f2818 100644 --- a/.github/actions/install/install-struphy/action.yml +++ b/.github/actions/install/install-struphy/action.yml @@ -12,8 +12,6 @@ runs: - name: Install struphy shell: bash run: | - python3 -m venv env - source env/bin/activate pip install --upgrade pip pip install ".[${{ inputs.optional-deps }}]" pip list diff --git a/.github/workflows/test-PR-pure-python.yml b/.github/workflows/test-PR-pure-python.yml index 87895c08c..806d78c6e 100644 --- a/.github/workflows/test-PR-pure-python.yml +++ b/.github/workflows/test-PR-pure-python.yml @@ -63,6 +63,11 @@ jobs: shell: bash run: apt install -y sqlite3 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.10" + - name: Install Struphy uses: ./.github/actions/install/install-struphy From ca4a5a90ae904b27e0532213299279c158121559 Mon Sep 17 00:00:00 2001 From: Stefan Possanner Date: Mon, 24 Nov 2025 21:49:14 +0100 Subject: [PATCH 02/12] run the PR tests every Sunday scheduled (this will create devel cache) --- .github/workflows/test-PR-models-clones.yml | 3 +++ .github/workflows/test-PR-models.yml | 3 +++ .github/workflows/test-PR-pure-python.yml | 3 +++ .github/workflows/test-PR-unit.yml | 3 +++ 4 files changed, 12 insertions(+) diff --git a/.github/workflows/test-PR-models-clones.yml b/.github/workflows/test-PR-models-clones.yml index 3cc671412..d363e909e 100644 --- a/.github/workflows/test-PR-models-clones.yml +++ b/.github/workflows/test-PR-models-clones.yml @@ -7,6 +7,9 @@ on: push: branches: - devel + schedule: + # run at 1 a.m. on Sunday + - cron: "0 1 * * 0" workflow_dispatch: concurrency: diff --git a/.github/workflows/test-PR-models.yml b/.github/workflows/test-PR-models.yml index 787650dee..4db68eadd 100644 --- a/.github/workflows/test-PR-models.yml +++ b/.github/workflows/test-PR-models.yml @@ -7,6 +7,9 @@ on: push: branches: - devel + schedule: + # run at 1 a.m. on Sunday + - cron: "0 1 * * 0" workflow_dispatch: concurrency: diff --git a/.github/workflows/test-PR-pure-python.yml b/.github/workflows/test-PR-pure-python.yml index 806d78c6e..2d277553c 100644 --- a/.github/workflows/test-PR-pure-python.yml +++ b/.github/workflows/test-PR-pure-python.yml @@ -7,6 +7,9 @@ on: push: branches: - devel + schedule: + # run at 1 a.m. on Sunday + - cron: "0 1 * * 0" workflow_dispatch: concurrency: diff --git a/.github/workflows/test-PR-unit.yml b/.github/workflows/test-PR-unit.yml index b78cf01b1..451e6ee4d 100644 --- a/.github/workflows/test-PR-unit.yml +++ b/.github/workflows/test-PR-unit.yml @@ -7,6 +7,9 @@ on: push: branches: - devel + schedule: + # run at 1 a.m. on Sunday + - cron: "0 1 * * 0" workflow_dispatch: concurrency: From 6ecfcec36c9a43bf4edc58d76eed6697b3d7788c Mon Sep 17 00:00:00 2001 From: Stefan Possanner Date: Mon, 24 Nov 2025 21:57:10 +0100 Subject: [PATCH 03/12] remove sqlite3 install from PR tests --- .github/workflows/test-PR-models-clones.yml | 5 ----- .github/workflows/test-PR-models.yml | 5 ----- .github/workflows/test-PR-pure-python.yml | 5 ----- .github/workflows/test-PR-unit.yml | 5 ----- 4 files changed, 20 deletions(-) diff --git a/.github/workflows/test-PR-models-clones.yml b/.github/workflows/test-PR-models-clones.yml index d363e909e..8e320660f 100644 --- a/.github/workflows/test-PR-models-clones.yml +++ b/.github/workflows/test-PR-models-clones.yml @@ -60,11 +60,6 @@ jobs: run: | ls .testmon* || echo "No .testmondata" - # This step can be removed when the updated ghcr images are pushed - - name: Install sqlite - shell: bash - run: apt install -y sqlite3 - - name: Install Struphy in Container uses: ./.github/actions/install/struphy_in_container diff --git a/.github/workflows/test-PR-models.yml b/.github/workflows/test-PR-models.yml index 4db68eadd..a8c6bc563 100644 --- a/.github/workflows/test-PR-models.yml +++ b/.github/workflows/test-PR-models.yml @@ -61,11 +61,6 @@ jobs: run: | ls .testmon* || echo "No .testmondata" - # This step can be removed when the updated ghcr images are pushed - - name: Install sqlite - shell: bash - run: apt install -y sqlite3 - - name: Install Struphy in Container uses: ./.github/actions/install/struphy_in_container diff --git a/.github/workflows/test-PR-pure-python.yml b/.github/workflows/test-PR-pure-python.yml index 2d277553c..bf6f56e48 100644 --- a/.github/workflows/test-PR-pure-python.yml +++ b/.github/workflows/test-PR-pure-python.yml @@ -61,11 +61,6 @@ jobs: run: | ls .testmon* || echo "No .testmondata" - # This step can be removed when the updated ghcr images are pushed - - name: Install sqlite - shell: bash - run: apt install -y sqlite3 - - name: Set up Python uses: actions/setup-python@v5 with: diff --git a/.github/workflows/test-PR-unit.yml b/.github/workflows/test-PR-unit.yml index 451e6ee4d..fa16e504d 100644 --- a/.github/workflows/test-PR-unit.yml +++ b/.github/workflows/test-PR-unit.yml @@ -61,11 +61,6 @@ jobs: run: | ls .testmon* || echo "No .testmondata" - # This step can be removed when the updated ghcr images are pushed - - name: Install sqlite - shell: bash - run: apt install -y sqlite3 - - name: Install Struphy in Container uses: ./.github/actions/install/struphy_in_container From 3135c54eaf960f3dce7687ebb04afd7aa30cfceb Mon Sep 17 00:00:00 2001 From: Stefan Possanner Date: Mon, 24 Nov 2025 22:05:56 +0100 Subject: [PATCH 04/12] perform the tests in reusable-testing workflow --- .github/workflows/macos-latest.yml | 7 ++---- .github/workflows/reusable-testing.yml | 35 +++++++++++++++++++++++--- 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/.github/workflows/macos-latest.yml b/.github/workflows/macos-latest.yml index 5d714e70a..36a3b1c32 100644 --- a/.github/workflows/macos-latest.yml +++ b/.github/workflows/macos-latest.yml @@ -1,9 +1,6 @@ name: MacOS on: - push: - branches: - - devel schedule: # run at 1 a.m. on Sunday - cron: "0 1 * * 0" @@ -13,7 +10,7 @@ concurrency: cancel-in-progress: true jobs: - macos-latest-build: - uses: ./.github/workflows/hello_world_reusable_wf.yml + ubuntu-latest-build: + uses: ./.github/workflows/reusable-testing.yml with: os: macos-latest \ No newline at end of file diff --git a/.github/workflows/reusable-testing.yml b/.github/workflows/reusable-testing.yml index 098431f3c..7f3428b92 100644 --- a/.github/workflows/reusable-testing.yml +++ b/.github/workflows/reusable-testing.yml @@ -18,7 +18,7 @@ jobs: matrix: python-version: ["3.12"] compile-language: ["fortran", "c"] - test-type: ["unit", "model"] #"quickstart", "tutorials"] + test-type: ["unit", "model", "verification"] #"quickstart", "tutorials"] steps: # Checkout the repository @@ -48,6 +48,7 @@ jobs: # Check that mpirun oversubscribing works, doesn't work unless OMPI_MCA_rmaps_base_oversubscribe==1 - name: Test mpirun + shell: bash run: | echo $OMPI_MCA_rmaps_base_oversubscribe echo $PRRTE_MCA_rmaps_base_oversubscribe @@ -71,8 +72,36 @@ jobs: # Run tests - name: Run unit tests if: matrix.test-type == 'unit' - uses: ./.github/actions/tests/unit + shell: bash + run: | + struphy test unit + + - name: Run unit tests with MPI + if: matrix.test-type == 'unit' + shell: bash + run: | + struphy test unit --mpi 2 - name: Run model tests if: matrix.test-type == 'model' - uses: ./.github/actions/tests/models + shell: bash + run: | + struphy test models + + - name: Run model tests with MPI + if: matrix.test-type == 'model' + shell: bash + run: | + struphy test models --mpi 2 + + - name: Run verification tests + if: matrix.test-type == 'verification' + shell: bash + run: | + struphy test verification + + - name: Run verification tests with MPI + if: matrix.test-type == 'verification' + shell: bash + run: | + struphy test verification --mpi 2 From b11ce1f01eb1f24bfbbfe07a443035dbde3e9dca Mon Sep 17 00:00:00 2001 From: Stefan Possanner Date: Mon, 24 Nov 2025 22:19:50 +0100 Subject: [PATCH 05/12] install struphy in venv in pure-python tests --- .github/workflows/test-PR-pure-python.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-PR-pure-python.yml b/.github/workflows/test-PR-pure-python.yml index bf6f56e48..81175021c 100644 --- a/.github/workflows/test-PR-pure-python.yml +++ b/.github/workflows/test-PR-pure-python.yml @@ -61,13 +61,12 @@ jobs: run: | ls .testmon* || echo "No .testmondata" - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.10" - - name: Install Struphy - uses: ./.github/actions/install/install-struphy + shell: bash + run: | + python3 -m venv env + source env/bin/activate + pip install .[dev] - name: LinearMHD test shell: bash From 67448cc323167bde1710a2fc76cf64b878a835f0 Mon Sep 17 00:00:00 2001 From: Stefan Possanner Date: Tue, 25 Nov 2025 13:28:45 +0100 Subject: [PATCH 06/12] add workflow_dispatch: to Ubuntu and MacOS tests --- .github/workflows/macos-latest.yml | 1 + .github/workflows/ubuntu-latest.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/macos-latest.yml b/.github/workflows/macos-latest.yml index 36a3b1c32..7f36c2748 100644 --- a/.github/workflows/macos-latest.yml +++ b/.github/workflows/macos-latest.yml @@ -4,6 +4,7 @@ on: schedule: # run at 1 a.m. on Sunday - cron: "0 1 * * 0" + workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/ubuntu-latest.yml b/.github/workflows/ubuntu-latest.yml index 91b46a929..2415f59f5 100644 --- a/.github/workflows/ubuntu-latest.yml +++ b/.github/workflows/ubuntu-latest.yml @@ -4,6 +4,7 @@ on: schedule: # run at 1 a.m. on Sunday - cron: "0 1 * * 0" + workflow_dispatch: jobs: ubuntu-latest-build: From 6d3ba988fb1febc1d7af4eebb1aa2dde59e34352 Mon Sep 17 00:00:00 2001 From: Stefan Possanner Date: Tue, 25 Nov 2025 13:29:48 +0100 Subject: [PATCH 07/12] run on push for testing --- .github/workflows/macos-latest.yml | 1 + .github/workflows/ubuntu-latest.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/macos-latest.yml b/.github/workflows/macos-latest.yml index 7f36c2748..23be06aae 100644 --- a/.github/workflows/macos-latest.yml +++ b/.github/workflows/macos-latest.yml @@ -5,6 +5,7 @@ on: # run at 1 a.m. on Sunday - cron: "0 1 * * 0" workflow_dispatch: + push: concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/ubuntu-latest.yml b/.github/workflows/ubuntu-latest.yml index 2415f59f5..a4e8cf21e 100644 --- a/.github/workflows/ubuntu-latest.yml +++ b/.github/workflows/ubuntu-latest.yml @@ -5,6 +5,7 @@ on: # run at 1 a.m. on Sunday - cron: "0 1 * * 0" workflow_dispatch: + push: jobs: ubuntu-latest-build: From 2a5199ff5e03d668df1b33afcf65e40a76aec014 Mon Sep 17 00:00:00 2001 From: Stefan Possanner Date: Wed, 26 Nov 2025 20:58:25 +0100 Subject: [PATCH 08/12] install gcc --- .../actions/install/macos-latest/action.yml | 6 +-- .github/workflows/macos-latest.yml | 2 +- .github/workflows/reusable-testing.yml | 44 +++++++++---------- .github/workflows/ubuntu-latest.yml | 2 +- 4 files changed, 25 insertions(+), 29 deletions(-) diff --git a/.github/actions/install/macos-latest/action.yml b/.github/actions/install/macos-latest/action.yml index 6e0593685..83ef1c35c 100644 --- a/.github/actions/install/macos-latest/action.yml +++ b/.github/actions/install/macos-latest/action.yml @@ -7,11 +7,9 @@ runs: shell: bash run: | set -euo pipefail - # ensure Homebrew bin is first export PATH="/opt/homebrew/bin:$PATH" brew update - # brew install python3 - # brew install gcc + brew install gcc brew install openblas brew install lapack brew install open-mpi @@ -29,9 +27,7 @@ runs: which gfortran || echo "could not find gfortran" which gcc || echo "could not find gcc" which g++ || echo "could not find g++" - # Update environment variables echo "FC=$(which gfortran)" >> $GITHUB_ENV # for gvec echo "CC=$(which gcc)" >> $GITHUB_ENV # for gvec echo "CXX=$(which g++)" >> $GITHUB_ENV # for gvec - echo "----------------" diff --git a/.github/workflows/macos-latest.yml b/.github/workflows/macos-latest.yml index 23be06aae..caf8ae29f 100644 --- a/.github/workflows/macos-latest.yml +++ b/.github/workflows/macos-latest.yml @@ -4,8 +4,8 @@ on: schedule: # run at 1 a.m. on Sunday - cron: "0 1 * * 0" - workflow_dispatch: push: + workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/reusable-testing.yml b/.github/workflows/reusable-testing.yml index 7f3428b92..bf7233ea4 100644 --- a/.github/workflows/reusable-testing.yml +++ b/.github/workflows/reusable-testing.yml @@ -70,17 +70,17 @@ jobs: uses: ./.github/actions/compile # Run tests - - name: Run unit tests - if: matrix.test-type == 'unit' - shell: bash - run: | - struphy test unit - - - name: Run unit tests with MPI - if: matrix.test-type == 'unit' - shell: bash - run: | - struphy test unit --mpi 2 + # - name: Run unit tests + # if: matrix.test-type == 'unit' + # shell: bash + # run: | + # struphy test unit + + # - name: Run unit tests with MPI + # if: matrix.test-type == 'unit' + # shell: bash + # run: | + # struphy test unit --mpi 2 - name: Run model tests if: matrix.test-type == 'model' @@ -94,14 +94,14 @@ jobs: run: | struphy test models --mpi 2 - - name: Run verification tests - if: matrix.test-type == 'verification' - shell: bash - run: | - struphy test verification - - - name: Run verification tests with MPI - if: matrix.test-type == 'verification' - shell: bash - run: | - struphy test verification --mpi 2 + # - name: Run verification tests + # if: matrix.test-type == 'verification' + # shell: bash + # run: | + # struphy test verification + + # - name: Run verification tests with MPI + # if: matrix.test-type == 'verification' + # shell: bash + # run: | + # struphy test verification --mpi 2 diff --git a/.github/workflows/ubuntu-latest.yml b/.github/workflows/ubuntu-latest.yml index a4e8cf21e..dca4baab4 100644 --- a/.github/workflows/ubuntu-latest.yml +++ b/.github/workflows/ubuntu-latest.yml @@ -4,8 +4,8 @@ on: schedule: # run at 1 a.m. on Sunday - cron: "0 1 * * 0" - workflow_dispatch: push: + workflow_dispatch: jobs: ubuntu-latest-build: From f48c9747a4e1e791919169f4c6a718e816b95aa0 Mon Sep 17 00:00:00 2001 From: Stefan Possanner Date: Wed, 26 Nov 2025 21:11:51 +0100 Subject: [PATCH 09/12] install gfortran --- .github/actions/install/macos-latest/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/install/macos-latest/action.yml b/.github/actions/install/macos-latest/action.yml index 83ef1c35c..3453631c7 100644 --- a/.github/actions/install/macos-latest/action.yml +++ b/.github/actions/install/macos-latest/action.yml @@ -10,6 +10,7 @@ runs: export PATH="/opt/homebrew/bin:$PATH" brew update brew install gcc + brew install gfortran brew install openblas brew install lapack brew install open-mpi From 041f7844165fce3ec8ab6a2d3691f0996e6e124e Mon Sep 17 00:00:00 2001 From: Stefan Possanner Date: Wed, 26 Nov 2025 21:25:31 +0100 Subject: [PATCH 10/12] reinstall gcc --- .github/actions/install/macos-latest/action.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/actions/install/macos-latest/action.yml b/.github/actions/install/macos-latest/action.yml index 3453631c7..7e795b4e7 100644 --- a/.github/actions/install/macos-latest/action.yml +++ b/.github/actions/install/macos-latest/action.yml @@ -9,8 +9,7 @@ runs: set -euo pipefail export PATH="/opt/homebrew/bin:$PATH" brew update - brew install gcc - brew install gfortran + brew reinstall gcc brew install openblas brew install lapack brew install open-mpi From 0f1ae7201b45aec8dc98b2e5bea8741e6b303c79 Mon Sep 17 00:00:00 2001 From: Stefan Possanner Date: Wed, 26 Nov 2025 21:36:40 +0100 Subject: [PATCH 11/12] test only with mpi in reusable workflow; do not run on push --- .github/workflows/macos-latest.yml | 1 - .github/workflows/reusable-testing.yml | 28 +++++++++++++------------- .github/workflows/ubuntu-latest.yml | 1 - 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/.github/workflows/macos-latest.yml b/.github/workflows/macos-latest.yml index caf8ae29f..7f36c2748 100644 --- a/.github/workflows/macos-latest.yml +++ b/.github/workflows/macos-latest.yml @@ -4,7 +4,6 @@ on: schedule: # run at 1 a.m. on Sunday - cron: "0 1 * * 0" - push: workflow_dispatch: concurrency: diff --git a/.github/workflows/reusable-testing.yml b/.github/workflows/reusable-testing.yml index bf7233ea4..8d6cc509a 100644 --- a/.github/workflows/reusable-testing.yml +++ b/.github/workflows/reusable-testing.yml @@ -76,17 +76,17 @@ jobs: # run: | # struphy test unit - # - name: Run unit tests with MPI - # if: matrix.test-type == 'unit' - # shell: bash - # run: | - # struphy test unit --mpi 2 - - - name: Run model tests - if: matrix.test-type == 'model' + - name: Run unit tests with MPI + if: matrix.test-type == 'unit' shell: bash run: | - struphy test models + struphy test unit --mpi 2 + + # - name: Run model tests + # if: matrix.test-type == 'model' + # shell: bash + # run: | + # struphy test models - name: Run model tests with MPI if: matrix.test-type == 'model' @@ -100,8 +100,8 @@ jobs: # run: | # struphy test verification - # - name: Run verification tests with MPI - # if: matrix.test-type == 'verification' - # shell: bash - # run: | - # struphy test verification --mpi 2 + - name: Run verification tests with MPI + if: matrix.test-type == 'verification' + shell: bash + run: | + struphy test verification --mpi 2 diff --git a/.github/workflows/ubuntu-latest.yml b/.github/workflows/ubuntu-latest.yml index dca4baab4..2415f59f5 100644 --- a/.github/workflows/ubuntu-latest.yml +++ b/.github/workflows/ubuntu-latest.yml @@ -4,7 +4,6 @@ on: schedule: # run at 1 a.m. on Sunday - cron: "0 1 * * 0" - push: workflow_dispatch: jobs: From 5c67c7a21b21f462b1bb36911667433f28852b3d Mon Sep 17 00:00:00 2001 From: Stefan Possanner Date: Wed, 26 Nov 2025 21:39:29 +0100 Subject: [PATCH 12/12] update job names --- .github/workflows/macos-latest.yml | 2 +- .github/workflows/ubuntu-latest.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/macos-latest.yml b/.github/workflows/macos-latest.yml index 7f36c2748..6ab18e26d 100644 --- a/.github/workflows/macos-latest.yml +++ b/.github/workflows/macos-latest.yml @@ -11,7 +11,7 @@ concurrency: cancel-in-progress: true jobs: - ubuntu-latest-build: + macos-install-test: uses: ./.github/workflows/reusable-testing.yml with: os: macos-latest \ No newline at end of file diff --git a/.github/workflows/ubuntu-latest.yml b/.github/workflows/ubuntu-latest.yml index 2415f59f5..de7eb88b9 100644 --- a/.github/workflows/ubuntu-latest.yml +++ b/.github/workflows/ubuntu-latest.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: jobs: - ubuntu-latest-build: + ubuntu-install-test: uses: ./.github/workflows/reusable-testing.yml with: os: ubuntu-latest \ No newline at end of file