Skip to content

Commit f5184a7

Browse files
authored
Merge pull request #31 from xcompact3d/jq/fix-fprettify
Cleanup Github Actions and fix fprettify
2 parents 18fe0bd + e455adc commit f5184a7

File tree

4 files changed

+19
-28
lines changed

4 files changed

+19
-28
lines changed

.fprettify.ini

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,8 @@ whitespace = 2
99
enable-decl = true
1010
enable-replacements = true
1111
c-relations = true
12+
13+
# Hack to stop fprettify formatting CUDA-style chevrons from <<< to < < <
14+
# We just ignore all files calling kernels:
15+
# TODO delete me when relevant PR for fprettify is merged: https://github.com/pseewald/fprettify/pull/162
16+
exclude = ["exec_dist.f90"]

.github/workflows/build_and_test.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
name: Run unit tests
22

33
on:
4-
push:
4+
pull_request:
5+
paths:
6+
- 'src/**'
7+
- 'tests/**'
58

69
jobs:
710
unit-tests:
@@ -10,15 +13,15 @@ jobs:
1013
OMPI_VERSION: 4.1.5
1114
steps:
1215

13-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
1417

1518
# We don't want to build openmpi each time this workflow is
1619
# run. Setup caching of OpenMPI after it is built and installed.
1720
# See "Caching dependencies to speed up workflows" on the GH
1821
# actions docs.
1922
- name: Cache OpenMPI
2023
id: cache-openmpi
21-
uses: actions/cache@v2
24+
uses: actions/cache@v4
2225
with:
2326
path: openmpi-${{ env.OMPI_VERSION }}/installed
2427
key: openmpi-${{ env.OMPI_VERSION }}

.github/workflows/check_commit_messages.sh

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,17 @@
11
name: check-policies
2-
on: [push]
2+
3+
on: [pull_request]
4+
35
jobs:
4-
check-commit-messages:
5-
runs-on: ubuntu-latest
6-
steps:
7-
- uses: actions/checkout@v3
8-
with:
9-
# Checkout with full history, not just latest revision.
10-
fetch-depth: 0
11-
- uses: actions/setup-python@v4
12-
- run: |
13-
bash .github/workflows/check_commit_messages.sh \
14-
${{ github.event.before }} ${{ github.event.after }}
156
check-formatting:
167
runs-on: ubuntu-latest
178
steps:
18-
- uses: actions/setup-python@v4
19-
- uses: actions/checkout@v3
9+
- uses: actions/checkout@v4
10+
- uses: actions/setup-python@v5
11+
with:
12+
python-version: '3.10'
2013
- run: pip install fprettify
2114
- run: fprettify --config .fprettify.ini --diff --recursive src
22-
- run: test -z "$($FPRETTIFY_COMMAND)"
15+
- run: if [[ ! -z "$($FPRETTIFY_COMMAND)" ]]; then echo "::warning::Code formatting issues detected. See log for details."; fi
2316
env:
2417
FPRETTIFY_COMMAND: fprettify --config .fprettify.ini --diff --recursive src

0 commit comments

Comments
 (0)