Skip to content

Commit

Permalink
Fix pip installs in GitHub Actions
Browse files Browse the repository at this point in the history
The `pip install` command now requires passing `--break-system-packages`,
otherwise it refuses the install.
To solve this, it's best to install with `pipx`.

In addition, this commit removes cache for `pip install poetry`, because the speedup is minimal
and totally not worth the effort.
  • Loading branch information
jiridanek committed Oct 14, 2024
1 parent dc6e870 commit 428f809
Showing 1 changed file with 10 additions and 28 deletions.
38 changes: 10 additions & 28 deletions .github/workflows/code_quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install robotframework-robocop
run: pipx install robotframework-robocop
- name: Run robocop
run: python -m robocop --verbose --reports sarif . || true
run: robocop --verbose --reports sarif . || true
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v2
with:
Expand All @@ -39,28 +37,21 @@ jobs:
name: python linters
runs-on: ubuntu-latest
env:
poetry_version: '1.7.1'
python_version: '3.11'
poetry_version: '1.8.3'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Cache poetry in ~/.local
uses: actions/cache@v4
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 }}
run: pipx install poetry==${{ env.poetry_version }}

- name: Set up Python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '${{ env.python_version }}'
cache: 'poetry'

- name: Configure poetry
Expand All @@ -86,28 +77,19 @@ jobs:
name: selftests
runs-on: ubuntu-latest
env:
poetry_version: '1.7.1'
python_version: '3.11'
poetry_version: '1.8.3'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Cache poetry in ~/.local
uses: actions/cache@v4
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 }}
run: pipx install poetry==${{ env.poetry_version }}

- name: Set up Python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '${{ env.python_version }}'
cache: 'poetry'

- name: Configure poetry
Expand Down

0 comments on commit 428f809

Please sign in to comment.