1
0
mirror of https://github.com/robertkrimen/otto synced 2025-10-12 20:27:30 +08:00

ci: use setup-go caching (#448)

Use setup-go caching instead of manually rolled version.

Also:
* Bump golangci-lint to 1.50.1.
* Add go 1.19 to test / lint matrix.
* Bump timeout to 6 mins.
This commit is contained in:
Steven Hartland 2022-11-25 15:00:07 +00:00 committed by GitHub
parent 93072360ee
commit ba066df8fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 26 deletions

View File

@ -8,36 +8,19 @@ jobs:
go-test-lint: go-test-lint:
strategy: strategy:
matrix: matrix:
go: [1.18] go: [1.19, 1.18]
golangcli: [v1.50.0] golangcli: [v1.50.1]
os: [ubuntu-latest] os: [ubuntu-latest]
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v3 uses: actions/setup-go@v3
with: with:
go-version: ${{ matrix.go }} go-version: ${{ matrix.go }}
cache: true
- name: Checkout
uses: actions/checkout@v3
- name: Go Cache Paths
id: go-cache-paths
run: |
echo "::set-output name=go-build::$(go env GOCACHE)"
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
- name: Go Build Cache
uses: actions/cache@v3
with:
path: ${{ steps.go-cache-paths.outputs.go-build }}
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
- name: Go Mod Cache
uses: actions/cache@v3
with:
path: ${{ steps.go-cache-paths.outputs.go-mod }}
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
- name: Validate go mod - name: Validate go mod
run: | run: |
@ -49,8 +32,7 @@ jobs:
with: with:
version: ${{ matrix.golangci }} version: ${{ matrix.golangci }}
args: "--out-${NO_FUTURE}format colored-line-number" args: "--out-${NO_FUTURE}format colored-line-number"
skip-pkg-cache: true skip-cache: true
skip-build-cache: true
- name: Go Build - name: Go Build
run: go build ./... run: go build ./...

View File

@ -1,6 +1,6 @@
run: run:
concurrency: 4 concurrency: 4
deadline: 5m deadline: 6m
skip-dirs: skip-dirs:
- terst - terst
skip-files: skip-files: