blob: e68b3eeb3a6002ef71829f1729ec21573ee46bda [file] [log] [blame]
# Generated by internal/ci/ci_tool.cue; do not edit
name: Test
on:
push:
branches:
- '*'
tags-ignore:
- v*
defaults:
run:
shell: bash
jobs:
test:
strategy:
fail-fast: false
matrix:
go-version:
- 1.12.x
- 1.13.x
- 1.14.3
os:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Cache Go modules
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-${{ matrix.go-version }}-go-${{ hashFiles('**/go.sum')
}}
restore-keys: ${{ runner.os }}-${{ matrix.go-version }}-go-
- if: matrix.go-version == '1.14.3' && matrix.os != 'windows-latest'
name: Generate
run: go generate ./...
- name: Test
run: go test ./...
- name: Test with -race
run: go test -race ./...
- if: matrix.go-version == '1.14.3' || matrix.go-version == '1.13.x'
name: gorelease check
run: go run golang.org/x/exp/cmd/gorelease
- name: Check that git is clean post generate and tests
run: test -z "$(git status --porcelain)" || (git status; git diff; false)
- if: github.ref == 'refs/heads/master'
name: Pull this commit through the proxy on master
run: |-
v=$(git rev-parse HEAD)
cd $(mktemp -d)
go mod init mod.com
GOPROXY=https://proxy.golang.org go get -d cuelang.org/go@$v