Skip to content

Commit 5c6e0f8

Browse files
committed
CI: add cache for venv made by poetry
1 parent d2003ec commit 5c6e0f8

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,17 @@ jobs:
1717
- uses: actions/checkout@v3
1818
- name: Set up Python 3.8
1919
uses: actions/setup-python@v4
20+
id: setup_python
2021
with:
2122
python-version: '3.8'
23+
24+
- name: Cache venv
25+
id: cache-venv
26+
uses: actions/cache@v3
27+
with:
28+
path: .venv
29+
key: venv-v1-test-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('poetry.lock') }}
30+
2231
- uses: Gr1N/setup-poetry@v7
2332
- name: Bootstrap environment
2433
run: |
@@ -39,10 +48,20 @@ jobs:
3948

4049
steps:
4150
- uses: actions/checkout@v3
51+
4252
- name: Set up Python ${{ matrix.python-version }}
4353
uses: actions/setup-python@v4
54+
id: setup_python
4455
with:
4556
python-version: ${{ matrix.python-version }}
57+
58+
- name: Cache venv
59+
id: cache-venv
60+
uses: actions/cache@v3
61+
with:
62+
path: .venv
63+
key: venv-v1-test-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('poetry.lock') }}
64+
4665
- uses: Gr1N/setup-poetry@v7
4766
- name: Bootstrap test environment
4867
run: |
@@ -60,8 +79,17 @@ jobs:
6079
- uses: actions/checkout@v3
6180
- name: Set up Python
6281
uses: actions/setup-python@v4
82+
id: setup_python
6383
with:
6484
python-version: "3.10"
85+
86+
- name: Cache venv
87+
id: cache-venv
88+
uses: actions/cache@v3
89+
with:
90+
path: .venv
91+
key: venv-v1-doc-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('poetry.lock') }}
92+
6593
- uses: Gr1N/setup-poetry@v7
6694
- name: Bootstrap test environment
6795
run: |

0 commit comments

Comments
 (0)