Skip to content

Commit 23d400b

Browse files
committed
- [!] fix CI build
1 parent b771b66 commit 23d400b

File tree

2 files changed

+22
-20
lines changed

2 files changed

+22
-20
lines changed

.github/workflows/go-release-build.yml

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,56 @@
11
name: build
22

3-
env:
4-
GO111MODULE: off
5-
63
on:
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

1613
jobs:
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

jsonfiddle_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
)
1010

1111
const (
12-
cmdTest = "jsonfiddle"
12+
cmdTest = "../jsonfiddle"
1313
dirTest = "test/"
1414
extRef = ".ref" // extension for reference file
1515
extGot = ".got" // extension for generated file

0 commit comments

Comments
 (0)