Merge pull request #1069 from golangci/feature/github-actions-mod-cache

dev: add mod cache in gh actions
This commit is contained in:
Aleksandr Razumov 2020-05-04 15:51:57 +03:00 committed by GitHub
commit 01b726a048
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,13 +13,12 @@ jobs:
strategy: strategy:
matrix: matrix:
golang: golang:
- 1.12
- 1.13 - 1.13
- 1.14 - 1.14
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Install Go - name: Install Go
uses: actions/setup-go@v1 uses: actions/setup-go@v2
with: with:
go-version: ${{ matrix.golang }} go-version: ${{ matrix.golang }}
- name: Run tests on Windows - name: Run tests on Windows
@ -30,7 +29,6 @@ jobs:
strategy: strategy:
matrix: matrix:
golang: golang:
- 1.12
- 1.13 - 1.13
- 1.14 - 1.14
os: os:
@ -39,9 +37,15 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Install Go - name: Install Go
uses: actions/setup-go@v1 uses: actions/setup-go@v2
with: with:
go-version: ${{ matrix.golang }} go-version: ${{ matrix.golang }}
- uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ matrix.golang }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ matrix.golang }}-
- name: Run tests on Unix-like operating systems - name: Run tests on Unix-like operating systems
run: make test run: make test
check_generated: check_generated:
@ -51,7 +55,7 @@ jobs:
- name: Unshallow - name: Unshallow
run: git fetch --prune --unshallow run: git fetch --prune --unshallow
- name: Install Go - name: Install Go
uses: actions/setup-go@v1 uses: actions/setup-go@v2
with: with:
go-version: 1.14 go-version: 1.14
- name: Check if README.md is up to date - name: Check if README.md is up to date