Skip to content

Commit 320a6b1

Browse files
authored
Improve CI workflow (#179)
* Install requirements directly * Remove restore-keys * Bump cache version
1 parent 6b97d95 commit 320a6b1

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

.github/workflows/ci.yaml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
pull_request: ~
99

1010
env:
11-
CACHE_VERSION: 1
11+
CACHE_VERSION: 2
1212
DEFAULT_PYTHON: 3.8
1313
LIB_FOLDER: python_typing_update
1414
PRE_COMMIT_CACHE: ~/.cache/pre-commit
@@ -43,16 +43,14 @@ jobs:
4343
key: >-
4444
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
4545
steps.generate-python-key.outputs.key }}
46-
restore-keys: |
47-
${{ runner.os }}-${{ steps.python.outputs.python-version }}-base-venv-${{ env.CACHE_VERSION }}-
4846
- name: Create Python virtual environment
4947
if: steps.cache-venv.outputs.cache-hit != 'true'
5048
run: |
5149
python -m venv venv
5250
. venv/bin/activate
5351
python -m pip install -U pip setuptools wheel
54-
pip install -U -r requirements_test.txt
55-
pip install -e .
52+
pip install -U -r requirements.txt -r requirements_test.txt
53+
pip install .
5654
- name: Generate pre-commit restore key
5755
id: generate-pre-commit-key
5856
run: >-
@@ -65,8 +63,6 @@ jobs:
6563
path: ${{ env.PRE_COMMIT_CACHE }}
6664
key: >-
6765
${{ runner.os }}-${{ steps.generate-pre-commit-key.outputs.key }}
68-
restore-keys: |
69-
${{ runner.os }}-pre-commit-${{ env.CACHE_VERSION }}-
7066
- name: Install pre-commit dependencies
7167
if: steps.cache-precommit.outputs.cache-hit != 'true'
7268
run: |
@@ -204,16 +200,14 @@ jobs:
204200
key: >-
205201
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
206202
steps.generate-python-key.outputs.key }}
207-
restore-keys: |
208-
${{ runner.os }}-${{ steps.python.outputs.python-version }}-venv-${{ env.CACHE_VERSION }}-
209203
- name: Create Python virtual environment
210204
if: steps.cache-venv.outputs.cache-hit != 'true'
211205
run: |
212206
python -m venv venv
213207
. venv/bin/activate
214208
python -m pip install -U pip setuptools wheel
215-
pip install -U -r requirements_test.txt
216-
pip install -e .
209+
pip install -U -r requirements.txt -r requirements_test.txt
210+
pip install .
217211
- name: Run pytest
218212
run: |
219213
. venv/bin/activate

0 commit comments

Comments
 (0)