Skip to content
Merged
5 changes: 5 additions & 0 deletions .fprettify.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@ whitespace = 2
enable-decl = true
enable-replacements = true
c-relations = true

# Hack to stop fprettify formatting CUDA-style chevrons from <<< to < < <
# We just ignore all files calling kernels:
# TODO delete me when relevant PR for fprettify is merged: https://github.com/pseewald/fprettify/pull/162
exclude = ["exec_dist.f90"]
9 changes: 6 additions & 3 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
name: Run unit tests

on:
push:
pull_request:
paths:
- 'src/**'
- 'tests/**'

jobs:
unit-tests:
Expand All @@ -10,15 +13,15 @@ jobs:
OMPI_VERSION: 4.1.5
steps:

- uses: actions/checkout@v3
- uses: actions/checkout@v4

# We don't want to build openmpi each time this workflow is
# run. Setup caching of OpenMPI after it is built and installed.
# See "Caching dependencies to speed up workflows" on the GH
# actions docs.
- name: Cache OpenMPI
id: cache-openmpi
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: openmpi-${{ env.OMPI_VERSION }}/installed
key: openmpi-${{ env.OMPI_VERSION }}
Expand Down
10 changes: 0 additions & 10 deletions .github/workflows/check_commit_messages.sh

This file was deleted.

23 changes: 8 additions & 15 deletions .github/workflows/check_policies.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
name: check-policies
on: [push]

on: [pull_request]

jobs:
check-commit-messages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
# Checkout with full history, not just latest revision.
fetch-depth: 0
- uses: actions/setup-python@v4
- run: |
bash .github/workflows/check_commit_messages.sh \
${{ github.event.before }} ${{ github.event.after }}
check-formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v4
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- run: pip install fprettify
- run: fprettify --config .fprettify.ini --diff --recursive src
- run: test -z "$($FPRETTIFY_COMMAND)"
- run: if [[ ! -z "$($FPRETTIFY_COMMAND)" ]]; then echo "::warning::Code formatting issues detected. See log for details."; fi
env:
FPRETTIFY_COMMAND: fprettify --config .fprettify.ini --diff --recursive src