-
Notifications
You must be signed in to change notification settings - Fork 16
103 lines (80 loc) · 2.56 KB
/
go-test.yml
File metadata and controls
103 lines (80 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# SPDX-FileCopyrightText: Copyright 2025 The SLSA Authors
# SPDX-License-Identifier: Apache-2.0
---
name: Go Tests (sourcetool)
on:
pull_request:
branches:
- main
permissions: {}
jobs:
go-versions:
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
latest: ${{ steps.go-versions.outputs.GO_VERSION_STABLE }}
previous: ${{ steps.go-versions.outputs.GO_VERSION_PREVIOUS }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: carabiner-dev/actions/go/versions@360ffa1eb909b0105d4eccb6d6ef337911c34952 # v1.1.6
id: go-versions
unit-test:
needs: go-versions
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
go-version:
- ${{ needs.go-versions.outputs.latest }}
- ${{ needs.go-versions.outputs.previous }}
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: ${{ matrix.go-version }}
check-latest: true
cache: false
- name: Run Go tests
run: |
go test -v ./...
test:
needs: [unit-test, verify]
runs-on: ubuntu-latest
steps:
- run: echo "All tests passed"
verify:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: carabiner-dev/actions/go/versions@360ffa1eb909b0105d4eccb6d6ef337911c34952 # v1.1.6
id: go-versions
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: ${{ steps.go-versions.outputs.GO_VERSION_STABLE }}
check-latest: true
cache: false
- name: Setup Buf
uses: bufbuild/buf-setup-action@a47c93e0b1648d5651a065437926377d060baa99 # v1.50.0
- name: Setup protoc
uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # @v3.0.0
- name: Check generated fakes
run: |
hack/verify-fakes.sh
- name: Check protobuf generated code
run: |
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
hack/verify-protos.sh