Update CI

This commit is contained in:
Andreas Bielawski 2022-06-25 23:48:42 +02:00
parent 19a99597fc
commit f73c99b79d
Signed by: Brawl
GPG Key ID: 851D5FF3B79056CA

View File

@ -4,31 +4,36 @@ on:
- pull_request
env:
GOVER: ^1.18
NAME: stargazer
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/setup-go@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GOVER }}
- uses: actions/checkout@v3
- uses: actions/cache@v3
go-version-file: 'go.mod'
- name: Checkout repo
uses: actions/checkout@v3
- name: Cache
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/.cache/go-build
~/Library/Caches/go-build
~\AppData\Local\go-build
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
key: ${{ runner.os }}-go-${{ env.GOVER }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ matrix.go-version }}-
- run: go test ./...
${{ runner.os }}-go-${{ env.GOVER }}-
- name: Run tests
run: go test ./...
build:
needs: test
@ -47,11 +52,16 @@ jobs:
GOARCH: arm
steps:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
- name: Checkout repo
uses: actions/checkout@v3
- name: Cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
@ -60,11 +70,6 @@ jobs:
restore-keys: |
${{ runner.os }}-go-
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GOVER }}
- name: Build
env:
GOOS: ${{ matrix.GOOS }}