From 4cc78e74ae1d3ca64f1dfc6e8d8b99fba46b341b Mon Sep 17 00:00:00 2001 From: Roman Cattaneo <1116746+romanc@users.noreply.github.com> Date: Tue, 28 Jan 2025 17:42:41 +0100 Subject: [PATCH] Streamline linting workflow Linting should give fast feedback. The current wokflow took almost 3 minutes where most time is spent installing (unnecessary) python packages. To run `pre-commit` we only need the source files and `pre-commit`, which can be installed standalone. This brings the runtime 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) --- .github/workflows/lint.yaml | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 041aca6..ee7a1b3 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -6,21 +6,18 @@ jobs: lint: runs-on: ubuntu-latest steps: - - name: Checkout Pace repository - uses: actions/checkout@v3.5.2 - with: - submodules: 'recursive' - - name: Step Python 3.11.7 - uses: actions/setup-python@v4.6.0 + - name: Checkout repository + uses: actions/checkout@v4 + + - 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 + python-version: '3.11' + + - name: Install pre-commit run: | - python -m pip install --upgrade pip setuptools wheel - pip install .[develop] + pip install pre-commit + - name: Run lint via pre-commit run: | pre-commit run --all-files