From 9c798a5a040d7497b71c9dc8ca373a924f72325f Mon Sep 17 00:00:00 2001 From: Billie Thompson Date: Fri, 5 Jun 2020 17:16:15 +0200 Subject: [PATCH] Cache stuff --- .github/workflows/release.yml | 19 ++++++++++++++----- .github/workflows/test-and-tag.yml | 23 +++++++++++++++++++++-- .github/workflows/update-tap.yml | 12 ++++++++++++ 3 files changed, 47 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bc4e537..b9f25c8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,8 +5,6 @@ on: tags: - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 -name: Release - jobs: test-windows: strategy: @@ -15,10 +13,16 @@ jobs: platform: [windows-latest] runs-on: ${{ matrix.platform }} steps: + - uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- - uses: actions/setup-go@v2.0.3 with: go-version: ${{ matrix.go-version }} - - uses: actions/checkout@v1 - run: make test-universal test: strategy: @@ -27,10 +31,16 @@ jobs: platform: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.platform }} steps: + - uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- - uses: actions/setup-go@v2.0.3 with: go-version: ${{ matrix.go-version }} - - uses: actions/checkout@v1 - run: make test build: @@ -39,7 +49,6 @@ jobs: matrix: platform: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.platform }} - name: Upload Release Asset steps: - uses: actions/checkout@v2 - uses: actions/setup-go@v2.0.3 diff --git a/.github/workflows/test-and-tag.yml b/.github/workflows/test-and-tag.yml index 748e889..4c168b1 100644 --- a/.github/workflows/test-and-tag.yml +++ b/.github/workflows/test-and-tag.yml @@ -11,10 +11,16 @@ jobs: platform: [windows-latest] runs-on: ${{ matrix.platform }} steps: + - uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- - uses: actions/setup-go@v1 with: go-version: ${{ matrix.go-version }} - - uses: actions/checkout@v1 - run: make test-universal test: strategy: @@ -23,10 +29,16 @@ jobs: platform: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.platform }} steps: + - uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- - uses: actions/setup-go@v1 with: go-version: ${{ matrix.go-version }} - - uses: actions/checkout@v1 - run: make test merge-and-push: if: contains( github.event.pull_request.labels.*.name, 'dependencies') || ( github.ref == 'refs/heads/master' && !contains(github.event.head_commit.message, 'Release v') ) @@ -39,6 +51,13 @@ jobs: with: token: '${{ secrets.COMMITTER_TOKEN }}' fetch-depth: 0 + - uses: actions/cache@v2 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* - id: get_previous_version run: echo ::set-output name=PREVIOUS_VERSION::$(git tag --sort=-creatordate | head -n 1) diff --git a/.github/workflows/update-tap.yml b/.github/workflows/update-tap.yml index b64472c..1dbc514 100644 --- a/.github/workflows/update-tap.yml +++ b/.github/workflows/update-tap.yml @@ -35,6 +35,18 @@ jobs: with: token: ${{ secrets.COMMITTER_TOKEN }} path: source-repo + - uses: actions/cache@v2 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + - id: get-brew-cache + run: | + echo "::set-output name=dir::$(brew --cache)" + - uses: actions/cache@v2 + with: + path: ${{ steps.get-brew-cache.outputs.dir }} - shell: bash run: | set -euo pipefail