diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d8b7cbd..d16936e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 }}