Skip to content

Commit

Permalink
Improve the code quality ruff action (red-hat-data-services#1119)
Browse files Browse the repository at this point in the history
* clone the bare minimum
* cache installed poetry
* cache poetry virtualenv
* run poetry check --lock

Signed-off-by: Jiri Daněk <jdanek@redhat.com>
  • Loading branch information
jiridanek authored Jan 16, 2024
1 parent e089fcb commit 4c6f667
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions .github/workflows/code_quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Get changed files
id: changed-files
Expand All @@ -84,15 +82,33 @@ jobs:
ruff:
name: ruff
runs-on: ubuntu-latest
env:
poetry_version: '1.7.1'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Cache poetry in ~/.local
uses: actions/cache@v3
id: cached-home-local
with:
path: ~/.local
key: ${{ runner.os }}-local-${{ env.poetry_version }}

- name: Install poetry
if: steps.cached-home-local.outputs.cache-hit != 'true'
run: pip install poetry==${{ env.poetry_version }}

- name: Set up Python
id: setup-python
uses: actions/setup-python@v5
with:
cache: 'poetry'

- run: poetry check --lock

- name: Install ruff
run: |
pip install poetry
poetry install --only dev
run: poetry install --only=dev --sync

- name: Run ruff check
run: poetry run ruff check ods_ci/
- run: poetry run ruff check ods_ci/

0 comments on commit 4c6f667

Please sign in to comment.