Skip to content

Commit

Permalink
chore: update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
vberlier committed Jan 31, 2023
1 parent f06dd1e commit 15f23c3
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
pull_request:
branches: [main]

env:
PYTHON_VERSION: "3.10"
POETRY_VERSION: "1.3.2"

jobs:
main:
name: Test and release
Expand All @@ -16,29 +20,30 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python 3.10
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: ${{ env.PYTHON_VERSION }}
- name: Cache poetry
id: cache-poetry
uses: actions/cache@v3
with:
path: ~/.local
key: poetry-${{ runner.os }}
key: poetry-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ env.POETRY_VERSION }}
- name: Install poetry
if: steps.cache-poetry.outputs.cache-hit != 'true'
uses: snok/install-poetry@v1
with:
version: ${{ env.POETRY_VERSION }}
virtualenvs-in-project: true
- name: Cache venv
id: cache-venv
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('poetry.lock') }}
key: venv-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ env.POETRY_VERSION }}-${{ hashFiles('poetry.lock') }}
restore-keys: |
venv-${{ runner.os }}-
venv-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ env.POETRY_VERSION }}-
- name: Install dependencies
if: steps.cache-venv.outputs.cache-hit != 'true'
run: poetry install
Expand Down

0 comments on commit 15f23c3

Please sign in to comment.