Skip to content

Commit

Permalink
Use new actions/setup-python builtin caching (theupdateframework#245)
Browse files Browse the repository at this point in the history
* Use new actions/setup-python builtin caching

Replaces more laborious use of actions/cache in GitHub
workflows.

Fixes theupdateframework#193
Closes theupdateframework#244


* Install bikeshed via requirements.txt

setup-python's cache feature, which was enabled in a previous
commits, requires a dependency file to work.

Signed-off-by: Lukas Puehringer <[email protected]>
  • Loading branch information
lukpueh authored Aug 24, 2022
1 parent 2ca6701 commit 70f167f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 39 deletions.
15 changes: 2 additions & 13 deletions .github/workflows/draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,14 @@ jobs:
uses: actions/setup-python@b55428b1882923874294fa556849718a1d7f2ca5
with:
python-version: 3.x

- name: Find pip cache dir
id: pip-cache
run: echo "::set-output name=dir::$(pip cache dir)"

- name: pip cache
uses: actions/cache@a7c34adf76222e77931dedbf4a45b2e4648ced19
with:
# Use the os dependent pip cache directory found above
path: ${{ steps.pip-cache.outputs.dir }}
# A match with 'restore-keys' is used as fallback
key: ${{ runner.os }}-pip-
cache: pip

- name: Clone
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b

- name: Build specification
run: |
python -m pip install bikeshed
python -m pip install -r requirements.txt
mkdir build && cd build
make -f ../Makefile draft
Expand Down
15 changes: 2 additions & 13 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,11 @@ jobs:
uses: actions/setup-python@b55428b1882923874294fa556849718a1d7f2ca5
with:
python-version: 3.x

- name: Find pip cache dir
id: pip-cache
run: echo "::set-output name=dir::$(pip cache dir)"

- name: pip cache
uses: actions/cache@a7c34adf76222e77931dedbf4a45b2e4648ced19
with:
# Use the os dependent pip cache directory found above
path: ${{ steps.pip-cache.outputs.dir }}
# A match with 'key' counts as cache hit
key: ${{ runner.os }}-pip-
cache: pip

- name: Ensure changes build
run: |
python -m pip install bikeshed
python -m pip install -r requirements.txt
mkdir build && cd build
make -f ../Makefile spec
Expand Down
15 changes: 2 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,7 @@ jobs:
uses: actions/setup-python@b55428b1882923874294fa556849718a1d7f2ca5
with:
python-version: 3.x

- name: Find pip cache dir
id: pip-cache
run: echo "::set-output name=dir::$(pip cache dir)"

- name: pip cache
uses: actions/cache@a7c34adf76222e77931dedbf4a45b2e4648ced19
with:
# Use the os dependent pip cache directory found above
path: ${{ steps.pip-cache.outputs.dir }}
# A match with 'key' counts as cache hit
key: ${{ runner.os }}-pip-
cache: 'pip'

- name: Clone main
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
Expand Down Expand Up @@ -56,7 +45,7 @@ jobs:
- name: Build specification
if: steps.getver.outputs.spec_version != steps.prevver.outputs.prev_version
run: |
python -m pip install bikeshed
python -m pip install -r requirements.txt
mkdir build && cd build
make -f ../Makefile release
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bikeshed

0 comments on commit 70f167f

Please sign in to comment.