Skip to content

Commit

Permalink
Devops: Use caching of setup-python action
Browse files Browse the repository at this point in the history
  • Loading branch information
sphuber committed Oct 4, 2023
1 parent 0f354b4 commit 89ff857
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 40 deletions.
24 changes: 5 additions & 19 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,7 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Cache Python dependencies
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: pip-pre-commit-${{ hashFiles('**/setup.json') }}
restore-keys:
pip-pre-commit-

- name: Install Python
- name: Install Python 3.10
uses: actions/setup-python@v2
with:
python-version: '3.10'
Expand Down Expand Up @@ -69,18 +61,12 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Cache Python dependencies
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: pip-${{ matrix.python-version }}-tests-${{ hashFiles('**/setup.json') }}
restore-keys:
pip-${{ matrix.python-version }}-tests

- name: Install Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: pyproject.toml

- name: Install system dependencies
run: sudo apt update && sudo apt install postgresql
Expand Down
28 changes: 7 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,12 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Cache Python dependencies
id: cache-pip
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: pip-pre-commit-${{ hashFiles('**/setup.json') }}
restore-keys:
pip-pre-commit-

- name: Install Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.8'
cache: 'pip'
cache-dependency-path: pyproject.toml

- name: Install Python dependencies
run: pip install -e .[pre-commit,tests]
Expand All @@ -49,19 +42,12 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Cache Python dependencies
id: cache-pip
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: pip-${{ matrix.python-version }}-tests-${{ hashFiles('**/setup.json') }}
restore-keys:
pip-${{ matrix.python-version }}-tests

- name: Install Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: pyproject.toml

- name: Install system dependencies
run: sudo apt update && sudo apt install postgresql
Expand Down

0 comments on commit 89ff857

Please sign in to comment.