forked from MetOffice/growss
-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (88 loc) · 2.93 KB
/
Copy pathfortran-lint.yaml
File metadata and controls
94 lines (88 loc) · 2.93 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# ------------------------------------------------------------------------------
# (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: Lint
on:
workflow_call:
inputs:
runner:
description: "The runner to use for the job"
required: false
type: string
default: "ubuntu-latest"
timeout:
description: "The maximum time in minutes the job can run for"
required: false
type: number
default: 10
python-version:
description: "The Python version to use"
required: false
type: string
default: "3.14"
fortitude-version:
description: "The Fortitude linter version to use"
required: false
type: string
default: "0.7.3"
file-extensions:
description: "Comma-separated list of Fortran file extensions to check"
required: false
type: string
default: "f90,F90,x90,X90,t90,T90,pf,PF"
respect-gitignore:
description: "Whether to respect .gitignore files"
required: false
type: boolean
default: true
show-fixes:
description: "Whether to show suggested fixes"
required: false
type: boolean
default: true
show-statistics:
description: "Whether to show statistics"
required: false
type: boolean
default: true
source-path:
description: "Path to source code directory to lint"
required: false
type: string
default: "."
fail-on-error:
description: "Whether to fail the workflow on linting errors"
required: false
type: boolean
default: true
enable-cache:
description: "Whether to enable UV cache"
required: false
type: boolean
default: false
jobs:
fortran-linting:
name: Fortran
runs-on: ${{ inputs.runner }}
timeout-minutes: ${{ inputs.timeout }}
env:
UV_PYTHON: ${{ inputs.python-version }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup uv and Python ${{ env.UV_PYTHON }}
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ env.UV_PYTHON }}
enable-cache: ${{ inputs.enable-cache }}
- name: Run Fortitude Linter
run: |
uvx --from fortitude-lint==${{ inputs.fortitude-version }} fortitude check \
${{ inputs.respect-gitignore && '--respect-gitignore' || '' }} \
${{ inputs.show-fixes && '--show-fixes' || '' }} \
${{ inputs.show-statistics && '--statistics' || '' }} \
--file-extensions=${{ inputs.file-extensions }} \
${{ inputs.source-path }}
continue-on-error: ${{ !inputs.fail-on-error }}