Skip to content

Commit 70f167f

Browse files
authored
Use new actions/setup-python builtin caching (#245)
* Use new actions/setup-python builtin caching Replaces more laborious use of actions/cache in GitHub workflows. Fixes #193 Closes #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]>
1 parent 2ca6701 commit 70f167f

File tree

4 files changed

+7
-39
lines changed

4 files changed

+7
-39
lines changed

.github/workflows/draft.yml

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,14 @@ jobs:
1313
uses: actions/setup-python@b55428b1882923874294fa556849718a1d7f2ca5
1414
with:
1515
python-version: 3.x
16-
17-
- name: Find pip cache dir
18-
id: pip-cache
19-
run: echo "::set-output name=dir::$(pip cache dir)"
20-
21-
- name: pip cache
22-
uses: actions/cache@a7c34adf76222e77931dedbf4a45b2e4648ced19
23-
with:
24-
# Use the os dependent pip cache directory found above
25-
path: ${{ steps.pip-cache.outputs.dir }}
26-
# A match with 'restore-keys' is used as fallback
27-
key: ${{ runner.os }}-pip-
16+
cache: pip
2817

2918
- name: Clone
3019
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
3120

3221
- name: Build specification
3322
run: |
34-
python -m pip install bikeshed
23+
python -m pip install -r requirements.txt
3524
mkdir build && cd build
3625
make -f ../Makefile draft
3726

.github/workflows/pr.yml

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,11 @@ jobs:
1717
uses: actions/setup-python@b55428b1882923874294fa556849718a1d7f2ca5
1818
with:
1919
python-version: 3.x
20-
21-
- name: Find pip cache dir
22-
id: pip-cache
23-
run: echo "::set-output name=dir::$(pip cache dir)"
24-
25-
- name: pip cache
26-
uses: actions/cache@a7c34adf76222e77931dedbf4a45b2e4648ced19
27-
with:
28-
# Use the os dependent pip cache directory found above
29-
path: ${{ steps.pip-cache.outputs.dir }}
30-
# A match with 'key' counts as cache hit
31-
key: ${{ runner.os }}-pip-
20+
cache: pip
3221

3322
- name: Ensure changes build
3423
run: |
35-
python -m pip install bikeshed
24+
python -m pip install -r requirements.txt
3625
mkdir build && cd build
3726
make -f ../Makefile spec
3827

.github/workflows/release.yml

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,7 @@ jobs:
1313
uses: actions/setup-python@b55428b1882923874294fa556849718a1d7f2ca5
1414
with:
1515
python-version: 3.x
16-
17-
- name: Find pip cache dir
18-
id: pip-cache
19-
run: echo "::set-output name=dir::$(pip cache dir)"
20-
21-
- name: pip cache
22-
uses: actions/cache@a7c34adf76222e77931dedbf4a45b2e4648ced19
23-
with:
24-
# Use the os dependent pip cache directory found above
25-
path: ${{ steps.pip-cache.outputs.dir }}
26-
# A match with 'key' counts as cache hit
27-
key: ${{ runner.os }}-pip-
16+
cache: 'pip'
2817

2918
- name: Clone main
3019
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
@@ -56,7 +45,7 @@ jobs:
5645
- name: Build specification
5746
if: steps.getver.outputs.spec_version != steps.prevver.outputs.prev_version
5847
run: |
59-
python -m pip install bikeshed
48+
python -m pip install -r requirements.txt
6049
mkdir build && cd build
6150
make -f ../Makefile release
6251

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bikeshed

0 commit comments

Comments
 (0)