update setup-go to v4 and use its caching by default
Vladimir Bauer
3 years ago
| 20 | 20 | os: [ubuntu-latest, macos-latest, windows-latest] |
| 21 | 21 | runs-on: ${{ matrix.os }} |
| 22 | 22 | steps: |
| 23 | - uses: actions/setup-go@v3 | |
| 23 | - uses: actions/checkout@v3 | |
| 24 | - uses: actions/setup-go@v4 | |
| 24 | 25 | with: |
| 25 | 26 | go-version: ${{ matrix.go-version }} |
| 26 | - uses: actions/checkout@v3 | |
| 27 | - uses: actions/cache@v3 | |
| 28 | with: | |
| 29 | # In order: | |
| 30 | # * Module download cache | |
| 31 | # * Build cache (Linux) | |
| 32 | # * Build cache (Mac) | |
| 33 | # * Build cache (Windows) | |
| 34 | path: | | |
| 35 | ~/go/pkg/mod | |
| 36 | ~/.cache/go-build | |
| 37 | ~/Library/Caches/go-build | |
| 38 | ~\AppData\Local\go-build | |
| 39 | key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }} | |
| 40 | restore-keys: | | |
| 41 | ${{ runner.os }}-go-${{ matrix.go-version }}- | |
| 42 | 27 | - run: go test -race ./... |