Skip to content

Commit

Permalink
CI: test go1.14 (#349)
Browse files Browse the repository at this point in the history
  • Loading branch information
fenollp authored Apr 26, 2021
1 parent f6c20c3 commit 38a7368
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
strategy:
fail-fast: true
matrix:
go: ['1.14', '1.x']
# Locked at https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
os:
- ubuntu-20.04
Expand All @@ -21,28 +22,32 @@ jobs:
defaults:
run:
shell: bash
name: ${{ matrix.go }} on ${{ matrix.os }}
steps:

- uses: actions/setup-go@v2
with:
go-version: 1.x
go-version: ${{ matrix.go }}

- id: go-cache-paths
run: |
echo "::set-output name=go-build::$(go env GOCACHE)"
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
- run: echo ${{ steps.go-cache-paths.outputs.go-build }}
- run: echo ${{ steps.go-cache-paths.outputs.go-mod }}

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

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


- uses: actions/checkout@v2
Expand All @@ -61,6 +66,7 @@ jobs:

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

Expand Down

0 comments on commit 38a7368

Please sign in to comment.