github actions: try caching the module cache
This commit is contained in:
parent
9c7e626f7d
commit
1250211381
24
.github/workflows/go.yml
vendored
24
.github/workflows/go.yml
vendored
@ -23,6 +23,14 @@ jobs:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Share cache with other actions
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/go/pkg/mod
|
||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-go-
|
||||
|
||||
- name: Ensure all files were formatted as per gofmt
|
||||
run: |
|
||||
gofmt -l $(find . -name '*.go') >/dev/null
|
||||
@ -50,6 +58,14 @@ jobs:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Share cache with other actions
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/go/pkg/mod
|
||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-go-
|
||||
|
||||
- name: Test
|
||||
run: |
|
||||
go test -v -race ./internal/...
|
||||
@ -69,6 +85,14 @@ jobs:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Share cache with other actions
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/go/pkg/mod
|
||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-go-
|
||||
|
||||
- name: Build Docker container with the tools our tests require
|
||||
run: |
|
||||
docker build --pull --no-cache --rm -t=router7 -f travis/Dockerfile .
|
||||
|
Loading…
x
Reference in New Issue
Block a user