Skip to content

Commit 38a7368

Browse files
authored
CI: test go1.14 (#349)
1 parent f6c20c3 commit 38a7368

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

.github/workflows/go.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
strategy:
1313
fail-fast: true
1414
matrix:
15+
go: ['1.14', '1.x']
1516
# Locked at https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
1617
os:
1718
- ubuntu-20.04
@@ -21,28 +22,32 @@ jobs:
2122
defaults:
2223
run:
2324
shell: bash
25+
name: ${{ matrix.go }} on ${{ matrix.os }}
2426
steps:
2527

2628
- uses: actions/setup-go@v2
2729
with:
28-
go-version: 1.x
30+
go-version: ${{ matrix.go }}
2931

3032
- id: go-cache-paths
3133
run: |
3234
echo "::set-output name=go-build::$(go env GOCACHE)"
3335
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
36+
- run: echo ${{ steps.go-cache-paths.outputs.go-build }}
37+
- run: echo ${{ steps.go-cache-paths.outputs.go-mod }}
3438

3539
- name: Go Build Cache
3640
uses: actions/cache@v2
3741
with:
3842
path: ${{ steps.go-cache-paths.outputs.go-build }}
39-
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
43+
key: ${{ runner.os }}-go-${{ matrix.go }}-build-${{ hashFiles('**/go.sum') }}
4044

41-
- name: Go Mod Cache
45+
- name: Go Mod Cache (go>=1.15)
4246
uses: actions/cache@v2
4347
with:
4448
path: ${{ steps.go-cache-paths.outputs.go-mod }}
45-
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
49+
key: ${{ runner.os }}-go-${{ matrix.go }}-mod-${{ hashFiles('**/go.sum') }}
50+
if: matrix.go != '1.14'
4651

4752

4853
- uses: actions/checkout@v2
@@ -61,6 +66,7 @@ jobs:
6166

6267
- run: go test ./...
6368
- run: cd openapi3/testdata && go test -tags with_embed ./... && cd -
69+
if: matrix.go != '1.14'
6470
- if: runner.os == 'Linux'
6571
run: git --no-pager diff && [[ $(git --no-pager diff --name-only | wc -l) = 0 ]]
6672

0 commit comments

Comments
 (0)