diff --git a/.github/workflows/go_test.yml b/.github/workflows/go_test.yml new file mode 100644 index 00000000..50f5ae29 --- /dev/null +++ b/.github/workflows/go_test.yml @@ -0,0 +1,18 @@ +on: [push, pull_request] +name: Test Go +permissions: + contents: read +jobs: + test: + strategy: + matrix: + go-version: [1.22.x] + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 + with: + go-version: ${{ matrix.go-version }} + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v3.1.0 + - run: go test -v -race -covermode=atomic -coverprofile=coverage.out ./... + - uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4 diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml new file mode 100644 index 00000000..9a51d80d --- /dev/null +++ b/.github/workflows/golangci-lint.yml @@ -0,0 +1,23 @@ +name: golangci-lint + +on: + push: + pull_request: + +permissions: + contents: read + +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 + with: + go-version: "1.22" + - name: golangci-lint + uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0 + with: + version: v1.55.1 + args: --timeout=8m diff --git a/.github/workflows/govulncheck.yml b/.github/workflows/govulncheck.yml new file mode 100644 index 00000000..24a2b999 --- /dev/null +++ b/.github/workflows/govulncheck.yml @@ -0,0 +1,23 @@ +name: govulncheck + +on: + push: + branches: + - main + pull_request: + branches: + - main + +permissions: + contents: read + +jobs: + govulncheck_job: + runs-on: ubuntu-latest + name: Run govulncheck + steps: + - id: govulncheck + uses: golang/govulncheck-action@7da72f730e37eeaad891fcff0a532d27ed737cd4 # v1.0.1 + with: + go-version-input: 1.22.4 + go-package: ./... diff --git a/cmd/example-gcp/main.go b/cmd/example-gcp/main.go index 1ce0a346..7144ca47 100644 --- a/cmd/example-gcp/main.go +++ b/cmd/example-gcp/main.go @@ -21,18 +21,12 @@ import ( "flag" "io" "net/http" - "os" tessera "github.com/transparency-dev/trillian-tessera" "github.com/transparency-dev/trillian-tessera/storage/gcp" "k8s.io/klog/v2" ) -var ( - project = flag.String("project", os.Getenv("GOOGLE_CLOUD_PROJECT"), "GCP Project, take from env if unset") - listen = flag.String("listen", ":2024", "Address:port to listen on") -) - func main() { klog.InitFlags(nil) flag.Parse()