-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from chainguard-dev/add_ci_scripts
chore: add CI scripts
- Loading branch information
Showing
6 changed files
with
111 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Copyright 2023 Chainguard, Inc | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
spec: | ||
authorities: | ||
- keyless: | ||
url: https://fulcio.sigstore.dev | ||
identities: | ||
- subjectRegExp: [email protected]$ | ||
issuer: https://accounts.google.com | ||
ctlog: | ||
url: https://rekor.sigstore.dev | ||
- key: | ||
# Allow commits signed by Github (merge commits) | ||
kms: https://github.com/web-flow.gpg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Copyright 2023 Chainguard, Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: ci | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
|
||
jobs: | ||
ci: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
go_version: | ||
- '1.19' | ||
- '1.20' | ||
- '1.21' | ||
|
||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
|
||
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 | ||
with: | ||
go-version: ${{ matrix.go_version }} | ||
check-latest: true | ||
|
||
- run: | | ||
make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Copyright 2023 Chainguard, Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: lint | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
pull_request: | ||
|
||
jobs: | ||
golangci: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 | ||
with: | ||
go-version: '1.21' | ||
check-latest: true | ||
|
||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0 | ||
with: | ||
version: v1.55 | ||
args: --timeout=5m --verbose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright 2023 Chainguard, Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
linters: | ||
enable: | ||
- errcheck | ||
- gofmt | ||
- goimports | ||
- gosec | ||
- gocritic | ||
- misspell | ||
- revive | ||
- unused | ||
output: | ||
uniq-by-line: false | ||
run: | ||
issues-exit-code: 1 | ||
timeout: 10m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
SHELL=/bin/bash -o pipefail | ||
|
||
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) | ||
ifeq (,$(shell go env GOBIN)) | ||
GOBIN=$(shell go env GOPATH)/bin | ||
else | ||
GOBIN=$(shell go env GOBIN) | ||
endif | ||
|
||
|
||
GO ?= go | ||
TEST_FLAGS ?= -v -cover | ||
|
||
.PHONY: test | ||
test: | ||
$(GO) vet ./... | ||
$(GO) test ${TEST_FLAGS} ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters