Skip to content

Commit

Permalink
Use actions/setup-python cache, refs #6
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Nov 28, 2022
1 parent 4451c7c commit 42b07cf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 30 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/push.yml
Expand Up @@ -22,17 +22,11 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- uses: actions/cache@v3
name: Configure pip caching
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
python-version: "3.11"
cache: pip
- name: Install dependencies
run: |
pip install cookiecutter
pip install -r requirements.txt
- name: Build demo from template
run: |-
cat main/input-for-demo.txt | cookiecutter main
Expand Down
18 changes: 4 additions & 14 deletions {{cookiecutter.hyphenated}}/.github/workflows/publish.yml
Expand Up @@ -19,13 +19,8 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v3
name: Configure pip caching
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
cache: pip
cache-dependency-path: setup.py
- name: Install dependencies
run: |
pip install -e '.[test]'
Expand All @@ -41,13 +36,8 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: "3.11"
- uses: actions/cache@v3
name: Configure pip caching
with:
path: ~/.cache/pip
key: ${{ runner.os }}-publish-pip-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-publish-pip-
cache: pip
cache-dependency-path: setup.py
- name: Install dependencies
run: |
pip install setuptools wheel twine build
Expand Down
9 changes: 2 additions & 7 deletions {{cookiecutter.hyphenated}}/.github/workflows/test.yml
Expand Up @@ -17,13 +17,8 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v3
name: Configure pip caching
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
cache: pip
cache-dependency-path: setup.py
- name: Install dependencies
run: |
pip install -e '.[test]'
Expand Down

0 comments on commit 42b07cf

Please sign in to comment.