blob: c25a349a39f5d6dac9299f5833d23c4a97db92db [file] [log] [blame]
# Generated by internal/ci/ci_tool.cue; do not edit
name: Test
defaults:
run:
shell: bash
on:
push:
branches:
- '*'
tags-ignore:
- v*
jobs:
test:
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-
- name: Generate
if: matrix.go-version == '1.14.3' && matrix.os != 'windows-latest'
run: |-
go generate ./...
go generate ./.github/workflows
- name: Test
run: go test ./...
- name: Test with -race
run: go test -race ./...
- 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)
- name: Pull this commit through the proxy on master
if: github.ref == 'refs/heads/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
strategy:
matrix:
go-version:
- 1.12.x
- 1.13.x
- 1.14.3
os:
- ubuntu-latest
- macos-latest
- windows-latest
fail-fast: false