-
Notifications
You must be signed in to change notification settings - Fork 8
75 lines (64 loc) · 2.15 KB
/
Copy pathfortran-lint.yaml
File metadata and controls
75 lines (64 loc) · 2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# ------------------------------------------------------------------------------
# (c) Crown copyright Met Office. All rights reserved.
# The file LICENCE, distributed with this code, contains details of the terms
# under which the code may be used.
# ------------------------------------------------------------------------------
name: Fortran lint
on:
workflow_call:
inputs:
runner:
description: 'The runner to use for the job'
required: false
default: 'ubuntu-latest'
timeout:
description: 'The maximum time in minutes the job can run for'
required: false
default: 10
python-version:
description: 'The Python version to use'
required: false
default: '3.14'
concurrency:
group: ${{ github.ref}}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
fortitude-linting:
name: Fortran lint
runs-on: ${{ inputs.runner }}
timeout-minutes: ${{ inputs.timeout }}
env:
UV_CACHE_DIR: /tmp/.uv_cache
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Setup uv
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ inputs.python-version }}
enable-cache: true
- name: restore uv cache
uses: actions/cache@v4
with:
path: ${{ env.UV_CACHE_DIR }}
key: ${{ runner.os }}-${{ hashFiles('uv.lock') }}
restore-keys: |
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
uv-${{ runner.os }}
- name: minimize uv cache
run: uv cache clean && uv cache prune || true
- name: Install Fortitude Linter
run: |
uv pip install fortitude-lint==0.7.3
- name: Run Fortitude Linter
run: |
output=$(fortitude check)
if [[ -n "$output" ]]; then
echo "$output"
echo "ERROR: Fortran styling issues found."
echo -e "\n Please run 'fortitude check --fix' to fix these"
echo "issues automatically where possible."
exit 1
else
echo "No Fortran styling issues found :) ."
fi