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