Skip to content

Commit

Permalink
Streamline linting workflow
Browse files Browse the repository at this point in the history
Linting should give fast feedback. The current workflow takes ~3mins
where most of the time is spent installing (unnecessary) python
packages. To run `pre-commit`, we only need the source files and
`pre-commit`itself, which can be installed standalone. This brings
runtime of the linting stage down to ~30 seconds.

Other changes

- update checkout action to v4
- update python setup action to v5
- change python version from 3.11.7 to 3.11 (any patch number will do)

This is a follow-up of PR NOAA-GFDL/PyFV3#40
in PyFV3.
  • Loading branch information
romanc committed Feb 12, 2025
1 parent 0aa1775 commit 141f4ed
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3.5.2
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Step Python
uses: actions/[email protected]

- name: Setup Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11.7'
- name: Install OpenMPI for gt4py
run: |
sudo apt-get install libopenmpi-dev
- name: Install Python packages
run: |
python -m pip install --upgrade pip setuptools wheel
pip install .[develop]
python-version: '3.11'

- name: Install pre-commit
run: pip install pre-commit

- name: Run lint via pre-commit
run: |
pre-commit run --all-files
run: pre-commit run --all-files

0 comments on commit 141f4ed

Please sign in to comment.