github actions: try caching the module cache

This commit is contained in:
Michael Stapelberg 2020-06-16 23:33:27 +02:00
parent 9c7e626f7d
commit 1250211381

View File

@ -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 .