From 1891310ec31d5e4e1968d8982da9f4e422eeeead Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Thu, 22 Jan 2026 11:06:36 -0700 Subject: [PATCH 1/5] Add comment to src/ccpp_hash_table.F90 so that file is 'modified' --- src/ccpp_hash_table.F90 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ccpp_hash_table.F90 b/src/ccpp_hash_table.F90 index 685c9049..af268450 100644 --- a/src/ccpp_hash_table.F90 +++ b/src/ccpp_hash_table.F90 @@ -1,6 +1,8 @@ !!XXgoldyXX: To do, statistics output module ccpp_hash_table +! Modify this file ... + use ccpp_hashable, only: ccpp_hashable_t implicit none From 4854c83c1b80800453090c2ab921bcb6176efe99 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Thu, 22 Jan 2026 11:22:19 -0700 Subject: [PATCH 2/5] Update existing GitHub action workflows: concurrency, only run for PRs to develop --- .github/workflows/capgen_unit_tests.yaml | 6 +++++- .github/workflows/prebuild.yaml | 1 + .github/workflows/python.yaml | 6 +++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/capgen_unit_tests.yaml b/.github/workflows/capgen_unit_tests.yaml index 374681f1..4b8598f0 100644 --- a/.github/workflows/capgen_unit_tests.yaml +++ b/.github/workflows/capgen_unit_tests.yaml @@ -3,7 +3,11 @@ name: Capgen Unit Tests on: workflow_dispatch: pull_request: - branches: [develop, main] + branches: [develop] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true jobs: unit_tests: diff --git a/.github/workflows/prebuild.yaml b/.github/workflows/prebuild.yaml index 43eda35c..6ef3841c 100644 --- a/.github/workflows/prebuild.yaml +++ b/.github/workflows/prebuild.yaml @@ -2,6 +2,7 @@ name: ccpp-prebuild on: pull_request: + branches: [develop] concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index fc12a3d1..b8508f2a 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -3,7 +3,11 @@ name: Python package on: workflow_dispatch: pull_request: - branches: [develop, main] + branches: [develop] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true jobs: build: From da63617e21184b4ab830bc37cc124b499b2a4bd0 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Thu, 22 Jan 2026 11:22:41 -0700 Subject: [PATCH 3/5] Turn off all tests except Codee formatting --- .github/workflows/{ => TMP_OFF}/capgen_unit_tests.yaml | 0 .github/workflows/{ => TMP_OFF}/prebuild.yaml | 0 .github/workflows/{ => TMP_OFF}/python.yaml | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{ => TMP_OFF}/capgen_unit_tests.yaml (100%) rename .github/workflows/{ => TMP_OFF}/prebuild.yaml (100%) rename .github/workflows/{ => TMP_OFF}/python.yaml (100%) diff --git a/.github/workflows/capgen_unit_tests.yaml b/.github/workflows/TMP_OFF/capgen_unit_tests.yaml similarity index 100% rename from .github/workflows/capgen_unit_tests.yaml rename to .github/workflows/TMP_OFF/capgen_unit_tests.yaml diff --git a/.github/workflows/prebuild.yaml b/.github/workflows/TMP_OFF/prebuild.yaml similarity index 100% rename from .github/workflows/prebuild.yaml rename to .github/workflows/TMP_OFF/prebuild.yaml diff --git a/.github/workflows/python.yaml b/.github/workflows/TMP_OFF/python.yaml similarity index 100% rename from .github/workflows/python.yaml rename to .github/workflows/TMP_OFF/python.yaml From adea079b28793f7c13a7c657a99ee1fe2f315a89 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Thu, 22 Jan 2026 11:07:06 -0700 Subject: [PATCH 4/5] Add .github/workflows/fortran-formatting.yaml --- .github/workflows/fortran-formatting.yaml | 73 +++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .github/workflows/fortran-formatting.yaml diff --git a/.github/workflows/fortran-formatting.yaml b/.github/workflows/fortran-formatting.yaml new file mode 100644 index 00000000..577649c7 --- /dev/null +++ b/.github/workflows/fortran-formatting.yaml @@ -0,0 +1,73 @@ +name: Codee format Fortran + +on: + pull_request: + branches: [develop] + types: [opened, synchronize, labeled, unlabeled] + +env: + CODEE_VERSION: 2025.4.5 + +permissions: + contents: write + pull-requests: write + +jobs: + format: + name: Check and fix Fortran formatting + runs-on: ubuntu-22.04 + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Get modified Fortran files + #id: modified-files + run: | + git remote -v show + git fetch origin ${{ github.base_ref }} + MODIFIED_FILES=$(git diff --name-only --diff-filter=d origin/${{ github.base_ref }}...HEAD -- '*.f90' '*.F90' '*.f' '*.F') + echo "MODIFIED_FILES=${MODIFIED_FILES}" >> ${GITHUB_ENV} + + - name: Install Codee + if: env.MODIFIED_FILES != '' + run: | + echo "Installing Codee ${CODEE_VERSION} ..." + wget https://codee.com/release/codee-${CODEE_VERSION}-linux-x86_64.tar.gz + tar -xf codee-${CODEE_VERSION}-linux-x86_64.tar.gz + + - name: Run `codee format` on modified files + if: env.MODIFIED_FILES != '' + run: | + export PATH="${PWD}/codee-${CODEE_VERSION}-linux-x86_64/bin:${PATH}" + codee format --accept-eula --verbose ${MODIFIED_FILES} + REFORMATTED_FILES=$(git diff --name-only --diff-filter=d) + echo "REFORMATTED_FILES=${REFORMATTED_FILES}" >> ${GITHUB_ENV} + + - name: Fail if there are uncommitted changes and the `fix-fortran-format` label is not present + if: ${{ env.REFORMATTED_FILES != '' && !contains(github.event.pull_request.labels.*.name, 'fix-fortran-format') }} + run: | + echo "Formatting issues detected. Run 'codee format' locally or attach label 'fix-fortran-format' to this PR." + exit 1 + +# - name: Fix formatting if label 'fix-fortran-format; is present +# if: ${{ env.MODIFIED_FILES != '' && contains(github.event.pull_request.labels.*.name, 'fix-fortran-format') }} +# run: | +# export PATH="${PWD}/codee-${CODEE_VERSION}-linux-x86_64/bin:${PATH}" +# git codee-format --diff origin/${{ github.base_ref }} HEAD +# git diff + + - name: Commit changes if the `fix-fortran-format` label is not present + if: ${{ env.REFORMATTED_FILES != '' && contains(github.event.pull_request.labels.*.name, 'fix-fortran-format') }} + run: | + # Push with the github-actions user. More information at: + # https://github.com/actions/checkout?tab=readme-ov-file#push-a-commit-using-the-built-in-token + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git checkout -b ${{ github.head_ref }} + git add ${REFORMATTED_FILES} + git commit -m "Apply codee format formatting fixes" + echo "DH DEBUG: 'git push --set-upstream origin ${{ github.head_ref }}'" + git push --set-upstream origin ${{ github.head_ref }} From 9a23af4cf0bb19bc2eab1998a210627827f2f1e0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 22 Jan 2026 21:05:45 +0000 Subject: [PATCH 5/5] Apply codee format formatting fixes --- src/ccpp_hash_table.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ccpp_hash_table.F90 b/src/ccpp_hash_table.F90 index af268450..6e08e8b2 100644 --- a/src/ccpp_hash_table.F90 +++ b/src/ccpp_hash_table.F90 @@ -1,7 +1,7 @@ !!XXgoldyXX: To do, statistics output module ccpp_hash_table -! Modify this file ... + ! Modify this file ... use ccpp_hashable, only: ccpp_hashable_t