Skip to content

Commit

Permalink
Cache stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
PurpleBooth committed Jun 5, 2020
1 parent f7da8f9 commit 9c798a5
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 7 deletions.
19 changes: 14 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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
Expand Down
23 changes: 21 additions & 2 deletions .github/workflows/test-and-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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') )
Expand All @@ -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)
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/update-tap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9c798a5

Please sign in to comment.