From 486afb97c1e3118fe099d133bdf5bc201c6bd4b9 Mon Sep 17 00:00:00 2001 From: Marcin Romaszewicz Date: Mon, 22 Jun 2026 07:37:59 -0700 Subject: [PATCH] Update CI settings Update CI to be consistent with other repos. --- .github/workflows/ci.yml | 32 ++++++++++---------------------- .github/workflows/lint.yml | 24 ------------------------ .github/workflows/tidy.yml | 27 --------------------------- Makefile | 8 ++++++-- 4 files changed, 16 insertions(+), 75 deletions(-) delete mode 100644 .github/workflows/lint.yml delete mode 100644 .github/workflows/tidy.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bf8fae9..a9b67f9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,24 +1,12 @@ -name: Build project -on: [ push, pull_request ] +name: CI +on: + push: {} + pull_request: {} + workflow_dispatch: {} +permissions: + contents: read jobs: build: - name: Build - runs-on: ubuntu-latest - strategy: - fail-fast: false - # perform matrix testing to give us an earlier insight into issues with different versions of supported major versions of Go - matrix: - version: - - "1.20" - - "1.21" - steps: - - name: Check out source code - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - - - name: Set up Go - uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5 - with: - go-version: ${{ matrix.version }} - - - name: Test - run: make test + uses: oapi-codegen/actions/.github/workflows/ci.yml@8ebfe4c83d051866a4af122ba602239fa3220e52 # v0.7.0 + with: + lint_versions: '["1.25"]' diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 8129954..0000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Lint project -on: [push, pull_request] -jobs: - build: - name: Build - runs-on: ubuntu-latest - strategy: - fail-fast: false - # perform matrix testing to give us an earlier insight into issues with different versions of supported major versions of Go - matrix: - version: - - "1.20" - - "1.21" - steps: - - name: Check out source code - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - - - name: Set up Go - uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5 - with: - go-version: ${{ matrix.version }} - - - name: Run `make lint-ci` - run: make lint-ci diff --git a/.github/workflows/tidy.yml b/.github/workflows/tidy.yml deleted file mode 100644 index b860c2d..0000000 --- a/.github/workflows/tidy.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Ensure `go mod tidy` has been run -on: [ push, pull_request ] -jobs: - build: - name: Build - runs-on: ubuntu-latest - strategy: - fail-fast: false - # perform matrix testing to give us an earlier insight into issues with different versions of supported major versions of Go - matrix: - version: - - "1.20" - - "1.21" - steps: - - name: Check out source code - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - - - name: Set up Go - uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5 - with: - go-version: ${{ matrix.version }} - - - name: Install `tidied` - run: go install gitlab.com/jamietanna/tidied@latest - - - name: Check for no untracked files - run: tidied -verbose diff --git a/Makefile b/Makefile index e2dd389..92113d8 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ help: @echo " lint run linting" $(GOBIN)/golangci-lint: - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN) v1.55.2 + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN) v2.10.1 .PHONY: tools tools: $(GOBIN)/golangci-lint @@ -18,7 +18,7 @@ lint: tools git ls-files go.mod '**/*go.mod' -z | xargs -0 -I{} bash -xc 'cd $$(dirname {}) && $(GOBIN)/golangci-lint run ./...' lint-ci: tools - git ls-files go.mod '**/*go.mod' -z | xargs -0 -I{} bash -xc 'cd $$(dirname {}) && $(GOBIN)/golangci-lint run ./... --out-format=github-actions --timeout=5m' + git ls-files go.mod '**/*go.mod' -z | xargs -0 -I{} bash -xc 'cd $$(dirname {}) && $(GOBIN)/golangci-lint run ./... --timeout=5m' test: git ls-files go.mod '**/*go.mod' -z | xargs -0 -I{} bash -xc 'cd $$(dirname {}) && go test -cover ./...' @@ -26,3 +26,7 @@ test: tidy: @echo "tidy..." git ls-files go.mod '**/*go.mod' -z | xargs -0 -I{} bash -xc 'cd $$(dirname {}) && go mod tidy' + +# Empty rule to make CI logic happy +.PHONY: generate +generate: ;