| 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: verify |
| 17 |
|
| 18 |
on: |
| 19 |
push: |
| 20 |
branches: |
| 21 |
- main |
| 22 |
pull_request: |
| 23 |
branches: |
| 24 |
- main |
| 25 |
|
| 26 |
permissions: {} |
| 27 |
|
| 28 |
jobs: |
| 29 |
license-check: |
| 30 |
name: license boilerplate check |
| 31 |
runs-on: ubuntu-latest |
| 32 |
|
| 33 |
permissions: |
| 34 |
contents: read |
| 35 |
|
| 36 |
steps: |
| 37 |
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 38 |
with: |
| 39 |
persist-credentials: false |
| 40 |
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 |
| 41 |
with: |
| 42 |
go-version-file: './go.mod' |
| 43 |
check-latest: true |
| 44 |
cache: false |
| 45 |
- name: Install addlicense |
| 46 |
run: go install github.com/google/[email protected] |
| 47 |
- name: Check license headers |
| 48 |
run: | |
| 49 |
set -e |
| 50 |
addlicense -l apache -c 'The Sigstore Authors' -v * |
| 51 |
git diff --exit-code |
| 52 |
|
| 53 |
golangci: |
| 54 |
name: lint checks |
| 55 |
runs-on: ubuntu-latest |
| 56 |
|
| 57 |
permissions: |
| 58 |
contents: read # for actions/checkout to fetch code |
| 59 |
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests |
| 60 |
|
| 61 |
strategy: |
| 62 |
fail-fast: false |
| 63 |
matrix: |
| 64 |
module: |
| 65 |
- ./ |
| 66 |
- pkg/signature/kms/aws |
| 67 |
- pkg/signature/kms/azure |
| 68 |
- pkg/signature/kms/gcp |
| 69 |
- pkg/signature/kms/hashivault |
| 70 |
|
| 71 |
steps: |
| 72 |
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 73 |
with: |
| 74 |
persist-credentials: false |
| 75 |
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 |
| 76 |
with: |
| 77 |
go-version-file: ${{ matrix.module }}/go.mod |
| 78 |
check-latest: true |
| 79 |
cache: false |
| 80 |
- name: golangci-lint |
| 81 |
uses: golangci/golangci-lint-action@82606bf257cbaff209d206a39f5134f0cfbfd2ee # v9.2.1 |
| 82 |
with: |
| 83 |
version: v2.4 |
| 84 |
working-directory: ${{ matrix.module }} |