File tree Expand file tree Collapse file tree 2 files changed +22
-20
lines changed Expand file tree Collapse file tree 2 files changed +22
-20
lines changed Original file line number Diff line number Diff line change 11name : build
22
3- env :
4- GO111MODULE : off
5-
63on :
74 push :
85 branches :
96 - ' master'
107 tags :
118 - ' v*'
12-
9+ pull_request :
1310 # Allows you to run this workflow manually from the Actions tab
1411 workflow_dispatch :
1512
1613jobs :
1714 build :
1815 runs-on : ubuntu-latest
1916 steps :
17+ -
18+ name : Checkout
19+ uses : actions/checkout@v4
20+ with :
21+ fetch-depth : 0
2022 -
2123 name : Set up Go
22- uses : actions/setup-go@v2
24+ uses : actions/setup-go@v5
2325 with :
24- go-version : 1.17
26+ go-version : 1.23.1
2527
2628 -
27- name : Checkout
28- uses : actions/checkout@v2
29+ name : Cache Go modules
30+ uses : actions/cache@v4
31+ # Do before go get
2932 with :
30- fetch-depth : 0
33+ path : ~/go/pkg/mod
34+ key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
35+ restore-keys : |
36+ ${{ runner.os }}-go-
3137
3238 -
3339 name : Tests
3440 run : |
35- export GOPATH=/home/runner/go
36- mkdir -vp $GOPATH/src/github.com/$GITHUB_REPOSITORY
37- rmdir -v $GOPATH/src/github.com/$GITHUB_REPOSITORY
38- mv -v $GITHUB_WORKSPACE $GOPATH/src/github.com/$GITHUB_REPOSITORY
39- ln -vs $GOPATH/src/github.com/$GITHUB_REPOSITORY $GITHUB_WORKSPACE
40- # go mod tidy
41- go get -v ./...
42- go build -v
41+ go mod tidy
42+ go build -v -trimpath
4343 go test -v ./...
44+ # for the next GoReleaser step
45+ git restore go.mod go.sum
4446
4547 -
4648 name : Run GoReleaser
47- uses : goreleaser/goreleaser-action@v2
49+ uses : goreleaser/goreleaser-action@v5
4850 if : success() && startsWith(github.ref, 'refs/tags/')
4951 with :
5052 version : latest
51- args : release --rm-dist
53+ args : release --clean
5254 env :
5355 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5456
Original file line number Diff line number Diff line change 99)
1010
1111const (
12- cmdTest = "jsonfiddle"
12+ cmdTest = "../ jsonfiddle"
1313 dirTest = "test/"
1414 extRef = ".ref" // extension for reference file
1515 extGot = ".got" // extension for generated file
You can’t perform that action at this time.
0 commit comments