Skip to content

Commit

Permalink
Simplify Poetry use and install in GH actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ktbyers committed Jun 24, 2024
1 parent 62898ad commit 65ecdcd
Showing 1 changed file with 22 additions and 32 deletions.
54 changes: 22 additions & 32 deletions .github/workflows/main_testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,23 @@ jobs:

- name: Setup python
uses: actions/setup-python@v5
id: cp311
with:
python-version: '3.11'
python-version: '3.12'
architecture: x64

- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.8.3
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install poetry
run: |
pipx install poetry
- name: Cache Poetry virtualenv
uses: actions/cache@v2
id: cached-poetry-dependencies
- name: Set up Python
uses: actions/setup-python@v5
with:
path: .venv
key: venv-${{ runner.os }}-cache-${{ steps.cp311.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
python-version: '3.12'
cache: 'poetry'

- name: Install Dependencies
run: poetry install
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
- name: Install dependencies
run: |
poetry install
- name: Run pylama
run: |
Expand Down Expand Up @@ -66,29 +61,24 @@ jobs:

- name: Setup python
uses: actions/setup-python@v5
id: py_ver
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- uses: actions/checkout@v4

- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.8.3
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install poetry
run: |
pipx install poetry
- name: Cache Poetry virtualenv
uses: actions/cache@v2
id: cached-poetry-dependencies
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
path: .venv
key: venv-${{ runner.os }}-cache-${{ steps.py_ver.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
if: ${{ matrix.platform != 'windows-latest' }} # windows hangs if using a cached venv
python-version: ${{ matrix.python-version }}
cache: 'poetry'

- name: Install Dependencies
run: poetry install
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
- name: Install dependencies
run: |
poetry install
- name: Run Tests
run: |
Expand Down

0 comments on commit 65ecdcd

Please sign in to comment.