Skip to content

Commit

Permalink
Use setup-python cache (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
antonagestam committed Oct 2, 2022
1 parent 0b1853f commit 867938c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 20 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}
- name: pip cache
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ inputs.python-version }}
restore-keys: ${{ runner.os }}-pip
cache: pip
cache-dependency-path: .pre-commit-config.yaml
check-latest: true
- name: pre-commit cache
uses: actions/cache@v3
with:
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/python-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,23 @@ on:
type: "string"
required: false
default: "setup.cfg"
python-version:
type: "string"
required: false
default: "3.10"

jobs:
build-and-publish:
name: Build and publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: pip cache
uses: actions/cache@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles(inputs.requirements_file) }}
restore-keys: ${{ runner.os }}-pip
python-version: ${{ inputs.python-version }}
cache: pip
cache-dependency-path: ${{ inputs.requirements_file }}
check-latest: true
- name: Install dependencies
run: python3 -m pip install --upgrade build pkginfo
- name: Build
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/python-test-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,23 @@ on:
type: "string"
required: false
default: "setup.cfg"
python-version:
type: "string"
required: false
default: "3.10"

jobs:
build-and-check:
name: Build and check package metadata
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: pip cache
uses: actions/cache@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles(inputs.requirements_file) }}
restore-keys: ${{ runner.os }}-pip
python-version: ${{ inputs.python-version }}
cache: pip
cache-dependency-path: ${{ inputs.requirements_file }}
check-latest: true
- name: Install dependencies
run: python3 -m pip install --upgrade build twine
- name: Build
Expand Down

0 comments on commit 867938c

Please sign in to comment.