File tree Expand file tree Collapse file tree 3 files changed +36
-17
lines changed Expand file tree Collapse file tree 3 files changed +36
-17
lines changed Original file line number Diff line number Diff line change @@ -5,23 +5,33 @@ name: Go Tests (sourcetool)
5
5
6
6
on :
7
7
pull_request :
8
+ branches :
9
+ - main
10
+
11
+ permissions : {}
8
12
9
13
jobs :
10
14
test :
15
+ runs-on : ubuntu-latest
16
+
11
17
permissions :
12
18
contents : read
13
- runs-on : ubuntu-latest
19
+
14
20
steps :
15
21
- name : Checkout code
16
22
uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
17
23
with :
18
24
persist-credentials : false
19
25
26
+ - name : Extract version of Go to use
27
+ run : echo "GOVERSION=$(awk -F'[:@]' '/FROM golang/{print $2; exit}' Dockerfile)" >> $GITHUB_ENV
28
+
20
29
- name : Set up Go
21
30
uses : actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
22
31
with :
23
- go-version-file : go.mod
32
+ go-version : ${{ env.GOVERSION }}
24
33
check-latest : true
34
+ cache : false
25
35
26
36
- name : Setup Buf
27
37
uses : bufbuild/buf-setup-action@a47c93e0b1648d5651a065437926377d060baa99 # v1.50.0
31
41
32
42
- name : Run Go tests
33
43
run : |
34
- go test ./...
44
+ go test -v ./...
35
45
36
46
- name : Check generated fakes
37
47
run : |
Original file line number Diff line number Diff line change 9
9
branches :
10
10
- main
11
11
12
- permissions :
13
- contents : read
12
+ permissions : {}
14
13
15
14
jobs :
16
15
golangci :
17
16
name : lint
18
17
runs-on : ubuntu-latest
18
+
19
+ permissions :
20
+ contents : read
21
+
19
22
steps :
20
23
- uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
21
24
with :
22
25
persist-credentials : false
23
26
27
+ - name : Extract version of Go to use
28
+ run : echo "GOVERSION=$(awk -F'[:@]' '/FROM golang/{print $2; exit}' Dockerfile)" >> $GITHUB_ENV
29
+
24
30
- uses : actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
25
31
with :
26
- go-version-file : go.mod
32
+ go-version : ${{ env.GOVERSION }}
33
+ check-latest : true
27
34
cache : false
28
35
29
36
- run : |
32
39
- name : Run golangci-lint
33
40
uses : golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
34
41
with :
35
- version : v2.1
36
-
42
+ version : v2.4
Original file line number Diff line number Diff line change 7
7
push :
8
8
tags :
9
9
- ' v*'
10
- permissions :
11
- contents : read
12
-
10
+
11
+ permissions : {}
12
+
13
13
jobs :
14
14
release :
15
15
runs-on : ubuntu-latest
18
18
id-token : write # To sign attestations
19
19
attestations : write # To push build provenance to attestations store
20
20
contents : write # To create the release
21
-
21
+
22
22
steps :
23
-
23
+
24
24
- name : Setup bnd
25
25
uses : carabiner-dev/actions/install/bnd@HEAD
26
26
30
30
persist-credentials : false
31
31
fetch-depth : 1
32
32
33
+ - name : Extract version of Go to use
34
+ run : echo "GOVERSION=$(awk -F'[:@]' '/FROM golang/{print $2; exit}' Dockerfile)" >> $GITHUB_ENV
35
+
33
36
- uses : actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
34
37
with :
35
- go-version-file : go.mod
38
+ go-version : ${{ env.GOVERSION }}
39
+ check-latest : true
36
40
cache : false
37
41
38
42
- name : Install tejolote
43
47
- name : Set tag output
44
48
id : tag
45
49
run : echo "tag_name=${GITHUB_REF#refs/*/}" >> "$GITHUB_OUTPUT"
46
-
50
+
47
51
- name : Run GoReleaser
48
52
uses : goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
49
53
id : goreleaser
67
71
bnd pack attestations/ > sourcetool.intoto.jsonl
68
72
gh release upload ${{ steps.tag.outputs.tag_name }} sourcetool.intoto.jsonl
69
73
# Remove this once GitHub like the tejolote build predicate
70
- # bnd push github ${{github.repository}} attestations/sourcetool-${{ steps.tag.outputs.tag_name }}.provenance.json
71
-
74
+ # bnd push github ${{github.repository}} attestations/sourcetool-${{ steps.tag.outputs.tag_name }}.provenance.json
You can’t perform that action at this time.
0 commit comments