Skip to content
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
6 changes: 5 additions & 1 deletion .github/workflows/capgen_unit_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/fortran-formatting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Codee format Fortran

on:
pull_request:
branches: [develop]
types: [opened, synchronize, labeled, unlabeled]

env:
CODEE_VERSION: 2025.4.5

# Only needed when fixing formatting automatically, but this only
# works for pull requests from the same repo, not from a fork
#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
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
if: ${{ env.REFORMATTED_FILES != '' }}
run: |
echo "Formatting issues detected. Run 'codee format' locally or apply the following diff manually:"
git diff
exit 1

1 change: 1 addition & 0 deletions .github/workflows/prebuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: ccpp-prebuild

on:
pull_request:
branches: [develop]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down