Skip to content
This repository was archived by the owner on Jul 5, 2023. It is now read-only.

Commit e0d4f73

Browse files
committed
Cache venv instead of pip wheels
1 parent abb5eaa commit e0d4f73

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

.github/workflows/main.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ jobs:
3535
needs: setup
3636
runs-on: ${{ matrix.os }}
3737
steps:
38+
- name: Check out repository
39+
uses: actions/checkout@v3
40+
- name: Load cached venv
41+
id: cached-poetry-dependencies
42+
uses: actions/cache@v3
43+
with:
44+
path: .venv
45+
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
3846
- name: Run Black
3947
run: |
4048
source .venv/scripts/activate

.github/workflows/publish.yaml

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Main CI pipeline
1+
name: Publish pipeline
22
on:
33
push:
44
tags:
@@ -13,6 +13,16 @@ jobs:
1313
shell: bash
1414
runs-on: ubuntu-latest
1515
steps:
16+
- name: Check out repository
17+
uses: actions/checkout@v3
18+
- name: Install Poetry
19+
uses: snok/install-poetry@v1
20+
- name: Load cached venv
21+
id: cached-poetry-dependencies
22+
uses: actions/cache@v3
23+
with:
24+
path: .venv
25+
key: venv-${{ runner.os }}-3.10-${{ hashFiles('**/poetry.lock') }}
1626
- name: Publish package to PyPi
1727
env:
1828
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}

setup-action/action.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ runs:
1818
virtualenvs-create: true
1919
virtualenvs-in-project: true
2020
- name: Load cached venv
21-
id: cached-pip-wheels
21+
id: cached-poetry-dependencies
2222
uses: actions/cache@v3
2323
with:
24-
path: ~/.cache
25-
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
24+
path: .venv
25+
key: venv-${{ runner.os }}-${{ inputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
2626
- name: Install dependencies
2727
shell: bash
2828
run: poetry install --no-interaction --no-root

0 commit comments

Comments
 (0)