| name: Test |
| |
| on: |
| push: |
| branches: |
| - '*' |
| tags-ignore: |
| - 'v*' |
| pull_request: |
| |
| defaults: |
| run: |
| shell: bash |
| |
| jobs: |
| test: |
| strategy: |
| fail-fast: false |
| matrix: |
| go-version: [1.13.x, 1.14.x] |
| platform: [ubuntu-latest, macos-latest, windows-latest] |
| runs-on: ${{ matrix.platform }} |
| steps: |
| - name: Install Go |
| uses: actions/setup-go@v1 |
| 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: Test |
| run: go test ./... |
| - name: Test with -race |
| run: go test -race ./... |
| |
| - name: gorelease check |
| run: go run -modfile=./.tools/go.mod golang.org/x/exp/cmd/gorelease |
| |
| - 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 cuelang.org/go@$v |