build: uses setup-go@v3 to simplify cache config

This updates to setup-go@v3 which is the only updated version (v2 last
updated in feb), and employs its cache to simplify workflow
configuration.

Notably, we can't do this for Alpine until #3146

Signed-off-by: Adrian Cole <adrian@tetrate.io>
This commit is contained in:
Adrian Cole
2022-09-09 08:14:58 +08:00
committed by Ron Evans
parent 617c7586fe
commit bba0dc9575
3 changed files with 22 additions and 49 deletions
+9 -14
View File
@@ -16,10 +16,6 @@ jobs:
name: build-macos
runs-on: macos-11
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: '1.18.1'
- name: Install Dependencies
shell: bash
run: |
@@ -35,6 +31,11 @@ jobs:
uses: actions/checkout@v2
with:
submodules: true
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: '1.18.1'
cache: true
- name: Cache LLVM source
uses: actions/cache@v3
id: cache-llvm-source
@@ -104,23 +105,17 @@ jobs:
name: homebrew-install
runs-on: macos-latest
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: '1.18'
- name: Install LLVM
shell: bash
run: |
HOMEBREW_NO_AUTO_UPDATE=1 brew install llvm@14
- name: Checkout
uses: actions/checkout@v2
- name: Cache Go
uses: actions/cache@v3
- name: Install Go
uses: actions/setup-go@v3
with:
key: go-cache-macos-homebrew-v1-${{ hashFiles('go.mod') }}
path: |
~/Library/Caches/go-build
~/go/pkg/mod
go-version: '1.18'
cache: true
- name: Build TinyGo
run: go install
- name: Check binary