Skip to content

Commit c83c105

Browse files
authored
CI: Add fortitude linter check (#202)
* Bump ubuntu runner for debug build * GCC-14 for debug build * Cancel in-progress jobs
1 parent 71f3fb8 commit c83c105

2 files changed

Lines changed: 46 additions & 23 deletions

File tree

.github/workflows/format-lint.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Format and lint
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
8+
env:
9+
FORCE_COLOR: 1
10+
11+
jobs:
12+
13+
format:
14+
name: Code format check
15+
runs-on: ubuntu-24.04
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: astral-sh/setup-uv@v6
20+
21+
- name: Run formatter
22+
run: |
23+
uv run autoformat.py
24+
f=`git ls-files -m`; if [[ -n $f ]]; then echo -e "ERROR: Detected unformatted files:\n$f"; exit 1; fi
25+
26+
lint:
27+
name: Lint check
28+
runs-on: ubuntu-24.04
29+
steps:
30+
- uses: actions/checkout@v4
31+
32+
- name: Install fortitude linter
33+
run: pip install fortitude-lint==0.7.1
34+
35+
- name: Lint check
36+
run: fortitude check src/

.github/workflows/gfortran.yml

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
11
name: GFortran CI
22

3-
# WARNING: When updating the OS version of the Github Actions runner,
3+
# WARNING: When updating the OS version of Github Actions runner,
44
# e.g. from Ubuntu 20.04 to 22.04, you need to manually update the cache keys!
55
# This is because there's no easy way to get the OS version from within this workflow file.
6+
# See https://github.com/PHOTOX/ABIN/issues/205
67

78
on:
89
push:
910
branches: [ master ]
1011
pull_request:
1112

13+
# Cancel in-progress jobs or runs for the current workflow - matches against branch & tags
14+
# https://docs.github.com/en/actions/using-jobs/using-concurrency
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
1219
env:
1320
# FFLAGS for building ABIN, applicable for most jobs
1421
ABIN_FFLAGS: -O0 -fopenmp --coverage -fprofile-abs-path -ffpe-trap=invalid,zero,overflow,denormal -fimplicit-none -Wall -Wno-integer-division -Wno-maybe-uninitialized
@@ -25,26 +32,6 @@ env:
2532

2633
jobs:
2734

28-
format:
29-
name: Code format check
30-
runs-on: ubuntu-latest
31-
32-
steps:
33-
- uses: actions/checkout@v4
34-
- uses: actions/setup-python@v5
35-
with:
36-
python-version: '3.11'
37-
38-
- name: Set up uv
39-
# Install a specific uv version using the installer
40-
run: curl -LsSf https://astral.sh/uv/0.3.0/install.sh | sh
41-
42-
- name: Run formatter (using uv)
43-
# uv ensures automatically that python dependencies are installed
44-
run: |
45-
uv run autoformat.py
46-
f=`git ls-files -m`; if [[ -n $f ]]; then echo -e "ERROR: Detected unformatted files:\n$f"; exit 1; fi
47-
4835
basic_build:
4936
name: Basic build
5037
runs-on: ubuntu-22.04
@@ -108,7 +95,7 @@ jobs:
10895

10996
debug_build:
11097
name: Debug build
111-
runs-on: ubuntu-22.04
98+
runs-on: ubuntu-24.04
11299

113100
steps:
114101
- uses: actions/checkout@v4
@@ -117,7 +104,7 @@ jobs:
117104
id: setup-fortran
118105
with:
119106
compiler: gcc
120-
version: '13'
107+
version: '14'
121108

122109
- name: Build ABIN
123110
run: ./configure && make

0 commit comments

Comments
 (0)