99 security-events : write
1010 steps :
1111 - name : Checkout repo
12- uses : actions/checkout@v2
12+ uses : actions/checkout@v4
1313 with :
1414 path : src/github.com/qiniu/go-sdk
1515 ref : ${{ github.ref }}
1616 submodules : recursive
1717 - name : Install Go
18- uses : actions/setup-go@v2
18+ uses : actions/setup-go@v5
1919 with :
20- go-version : ' 1.10.x '
20+ go-version : ' 1.10'
2121 - name : Run unit cases
2222 run : |
23- set -e
23+ set -ex
2424 rm -rf $GITHUB_WORKSPACE/src/github.com/qiniu/x && git clone -b v1.12.21 --depth 1 https://github.com/qiniu/x.git $GITHUB_WORKSPACE/src/github.com/qiniu/x
25- GOPATH=$GITHUB_WORKSPACE go get golang.org/x/sync/singleflight
25+
2626 GOPATH=$GITHUB_WORKSPACE go get github.com/qiniu/dyn
27- GOPATH=$GITHUB_WORKSPACE go get github.com/gofrs/flock
27+
28+ rm -rf $GITHUB_WORKSPACE/src/github.com/gofrs/flock && git clone -b v0.8.1 --depth 1 https://github.com/gofrs/flock $GITHUB_WORKSPACE/src/github.com/gofrs/flock
29+
2830 GOPATH=$GITHUB_WORKSPACE go get github.com/alex-ant/gomath/rational
29- GOPATH=$GITHUB_WORKSPACE go get github.com/matishsiao/goInfo
31+ GOPATH=$GITHUB_WORKSPACE go get github.com/gammazero/toposort
32+ GOPATH=$GITHUB_WORKSPACE go get github.com/joeshaw/multierror
3033
3134 # FIXME special package
3235 # github.com/go-playground/validator/v10
@@ -35,18 +38,21 @@ jobs:
3538 # new package name don't work in non-module mode
3639 rm -rf $GITHUB_WORKSPACE/src/github.com/go-playground/validator/v10 && git clone -b v10.9.0 --depth 1 https://github.com/go-playground/validator.git $GITHUB_WORKSPACE/src/github.com/go-playground/validator/v10
3740 rm -rf $GITHUB_WORKSPACE/src/github.com/universal-translator && git clone -b v0.18.0 --depth 1 https://github.com/go-playground/universal-translator.git $GITHUB_WORKSPACE/src/github.com/go-playground/universal-translator
38-
41+ rm -rf $GITHUB_WORKSPACE/src/github.com/elastic/go-sysinfo && git clone -b v1.0.2 --depth 1 https://github.com/elastic/go-sysinfo.git $GITHUB_WORKSPACE/src/github.com/elastic/go-sysinfo
42+ rm -rf $GITHUB_WORKSPACE/src/github.com/pkg/errors && git clone -b v0.9.1 --depth 1 https://github.com/pkg/errors.git $GITHUB_WORKSPACE/src/github.com/pkg/errors
43+ rm -rf $GITHUB_WORKSPACE/src/github.com/prometheus/procfs && git clone -b v0.0.6 --depth 1 https://github.com/prometheus/procfs.git $GITHUB_WORKSPACE/src/github.com/prometheus/procfs
44+ rm -rf $GITHUB_WORKSPACE/src/howett.net/plist && git clone -b v1.0.0 --depth 1 https://github.com/DHowett/go-plist.git $GITHUB_WORKSPACE/src/howett.net/plist
45+ rm -rf $GITHUB_WORKSPACE/src/golang.org/x/sys && git clone -b v0.13.0 --depth 1 https://github.com/golang/sys $GITHUB_WORKSPACE/src/golang.org/x/sys
3946 rm -rf $GITHUB_WORKSPACE/src/golang.org/x/crypto && git clone -b v0.10.0 --depth 1 https://go.googlesource.com/crypto $GITHUB_WORKSPACE/src/golang.org/x/crypto
40- # GOPATH=$GITHUB_WORKSPACE go get golang.org/x/crypto/sha3
41-
4247 rm -rf $GITHUB_WORKSPACE/src/golang.org/x/text && git clone -b v0.10.0 --depth 1 https://github.com/golang/text $GITHUB_WORKSPACE/src/golang.org/x/text
43- # GOPATH= $GITHUB_WORKSPACE go get golang.org/x/text/language
48+ rm -rf $GITHUB_WORKSPACE/src/golang.org/x/sync && git clone -b v0.3.0 --depth 1 https://github.com/ golang/sync $GITHUB_WORKSPACE/src/golang .org/x/sync
4449
4550 GOPATH=$GITHUB_WORKSPACE go get github.com/leodido/go-urn
4651 GOPATH=$GITHUB_WORKSPACE go get github.com/go-playground/locales
4752
4853 rm -rf $GITHUB_WORKSPACE/src/github.com/dave/jennifer && git clone -b v1.6.1 --depth 1 https://github.com/dave/jennifer $GITHUB_WORKSPACE/src/github.com/dave/jennifer
49- # GOPATH=$GITHUB_WORKSPACE go get github.com/dave/jennifer
54+ rm -rf $GITHUB_WORKSPACE/src/modernc.org/fileutil && git clone -b v1.0.0 --depth 1 https://gitlab.com/cznic/fileutil.git $GITHUB_WORKSPACE/src/modernc.org/fileutil
55+ rm -rf $GITHUB_WORKSPACE/src/github.com/gorilla/mux && git clone -b v1.7.4 --depth 1 https://github.com/gorilla/mux $GITHUB_WORKSPACE/src/github.com/gorilla/mux
5056
5157 GOPATH=$GITHUB_WORKSPACE go get github.com/iancoleman/strcase
5258
@@ -66,39 +72,88 @@ jobs:
6672 fail-fast : false
6773 max-parallel : 1
6874 matrix :
69- go_version : ['1.11.x ', '1.12.x ', '1.13.x ', '1.14.x ', '1.15.x ', '1.16.x ', '1.17.x ', '1.18.x ', '1.19.x ', '1.20.x ', '1.21.x ', '1.22.x ']
75+ go_version : ['1.11', '1.12', '1.13', '1.14', '1.15', '1.16', '1.17', '1.18', '1.19', '1.20', '1.21', '1.22']
7076 runs-on : ubuntu-latest
7177 permissions :
7278 actions : read
7379 contents : read
7480 security-events : write
7581 steps :
7682 - name : Checkout repo
77- uses : actions/checkout@v2
83+ uses : actions/checkout@v4
7884 with :
7985 ref : ${{ github.ref }}
8086 submodules : recursive
8187 - name : Install Go
82- uses : actions/setup-go@v2
88+ uses : actions/setup-go@v5
8389 with :
8490 go-version : ${{ matrix.go_version }}
8591 - name : Format
8692 run : |
87- if [ "${{ matrix.go_version }}" = "1.22.x " ]; then
93+ if [ "${{ matrix.go_version }}" = "1.22" ]; then
8894 if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then
8995 exit 1
9096 fi
9197 fi
9298 - name : Golint
9399 run : |
94- if [ "${{ matrix.go_version }}" = "1.22.x " ]; then
100+ if [ "${{ matrix.go_version }}" = "1.22" ]; then
95101 set -e
96102 go install honnef.co/go/tools/cmd/staticcheck@latest
97103 make staticcheck
98104 fi
99105 - name : Run unit cases
100106 run : |
101107 set -e
108+ if [ "${{ matrix.go_version }}" = "1.11" ] || [ "${{ matrix.go_version }}" = "1.12" ] || [ "${{ matrix.go_version }}" = "1.13" ] || [ "${{ matrix.go_version }}" = "1.14" ] || [ "${{ matrix.go_version }}" = "1.15" ]; then
109+ go get modernc.org/fileutil@v1.0.0
110+ fi
102111 make unittest
103112 env :
104113 GO111MODULE : ' on'
114+ go-mod-test-windows :
115+ needs : ' go-mod-test'
116+ runs-on : windows-latest
117+ permissions :
118+ actions : read
119+ contents : read
120+ security-events : write
121+ steps :
122+ - name : Checkout repo
123+ uses : actions/checkout@v4
124+ with :
125+ ref : ${{ github.ref }}
126+ submodules : recursive
127+ - name : Install Go
128+ uses : actions/setup-go@v5
129+ with :
130+ go-version : stable
131+ - name : Run unit cases
132+ run : |
133+ set -e
134+ make unittest
135+ shell : bash
136+ go-mod-test-macos :
137+ needs : ' go-mod-test-windows'
138+ runs-on : macos-latest
139+ permissions :
140+ actions : read
141+ contents : read
142+ security-events : write
143+ steps :
144+ - name : Checkout repo
145+ uses : actions/checkout@v4
146+ with :
147+ ref : ${{ github.ref }}
148+ submodules : recursive
149+ - name : Install Go
150+ uses : actions/setup-go@v5
151+ with :
152+ go-version : stable
153+ - name : Install dependencies
154+ run : |
155+ brew install make
156+ - name : Run unit cases
157+ run : |
158+ set -e
159+ make unittest
0 commit comments