Debian Codegraph @

.github/workflows/test.yml

raw
1 #
2 # Copyright 2021 The Sigstore Authors.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 # http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15
16 name: test
17
18 on:
19 push:
20 branches:
21 - main
22 pull_request:
23 branches:
24 - main
25
26 permissions: {}
27
28 jobs:
29 unit_test:
30 name: unit tests
31 runs-on: ubuntu-latest
32
33 permissions:
34 contents: read
35
36 strategy:
37 matrix:
38 go-version:
39 - 1.25.x
40
41 steps:
42 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
43 with:
44 persist-credentials: false
45
46 - name: Set up Go
47 uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
48 with:
49 go-version: ${{ matrix.go-version }}
50 check-latest: true
51 cache: false
52
53 - name: Cache Modules
54 uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
55 with:
56 path: ~/go/pkg/mod
57 key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
58 restore-keys: |
59 ${{ runner.os }}-go-
60
61 - run: |
62 for submodule in \
63 . \
64 pkg/signature/kms/aws \
65 pkg/signature/kms/azure \
66 pkg/signature/kms/gcp \
67 pkg/signature/kms/hashivault; do
68 pushd $submodule
69
70 go mod tidy
71 go build -v ./...
72 go test -v ./...
73
74 popd
75 done
76
77 - name: Ensure no files were modified as a result of the build
78 run: git update-index --refresh && git diff-index --quiet HEAD -- || git diff --exit-code