...
1---
2name: Go
3on: [push, pull_request]
4jobs:
5 test:
6 name: Test
7 runs-on: ubuntu-20.04
8 strategy:
9 fail-fast: false
10 matrix:
11 go:
12 - "1.5"
13 - "1.6"
14 - "1.7"
15 - "1.8"
16 - "1.9"
17 - "1.10"
18 - "1.11"
19 - "1.12"
20 - "1.13"
21 - "1.14"
22 - "1.15"
23 - "1.16.0-beta1"
24 - "tip"
25 env:
26 GOPATH: ${{ github.workspace }}/go
27 steps:
28 - name: Check out code into the Go module directory
29 uses: actions/checkout@v2
30 with:
31 path: ${{ github.workspace }}/go/src/gopkg.in/yaml.v3
32 - name: Set up Go ${{ matrix.go }}
33 if: matrix.go != 'tip'
34 uses: actions/setup-go@v2
35 with:
36 go-version: ${{ matrix.go }}
37 stable: false
38 - name: Set up Go ${{ matrix.go }}
39 if: matrix.go == 'tip'
40 run: |
41 export GOROOT_BOOTSTRAP=`go env GOROOT`
42 export GOROOT=$HOME/gotip
43 mkdir $HOME/gotip
44 cd $HOME/gotip
45
46 curl -s 'https://go.googlesource.com/go/+/refs/heads/master?format=JSON' | awk '/"commit"/{print substr($2,2,40);exit}' >HEAD
47 awk '{printf("gotip-%s",substr($0,0,7))}' <HEAD >VERSION
48
49 curl -s -o go.tar.gz https://go.googlesource.com/go/+archive/`cat HEAD`.tar.gz
50 tar xfz go.tar.gz
51
52 cd src
53 bash make.bash
54
55 echo "GOROOT=$GOROOT" >> $GITHUB_ENV
56 echo "$GOROOT/bin" >> $GITHUB_PATH
57 - run: go version
58 - run: go get -t ./...
59 working-directory: ${{ github.workspace }}/go/src/gopkg.in/yaml.v3
60 - run: go test .
61 working-directory: ${{ github.workspace }}/go/src/gopkg.in/yaml.v3
View as plain text