From 70f167f87bf5a437afb83b32735a98aea015732a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20P=C3=BChringer?= Date: Wed, 24 Aug 2022 08:51:51 +0200 Subject: [PATCH] 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 --- .github/workflows/draft.yml | 15 ++------------- .github/workflows/pr.yml | 15 ++------------- .github/workflows/release.yml | 15 ++------------- requirements.txt | 1 + 4 files changed, 7 insertions(+), 39 deletions(-) create mode 100644 requirements.txt diff --git a/.github/workflows/draft.yml b/.github/workflows/draft.yml index 355e9c7..c89276c 100644 --- a/.github/workflows/draft.yml +++ b/.github/workflows/draft.yml @@ -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 diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 1a2540b..03f6299 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d0e8c1c..aa55a55 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -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 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..7b706bb --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +bikeshed \ No newline at end of file