diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/ci.yml similarity index 51% rename from .github/workflows/golangci-lint.yml rename to .github/workflows/ci.yml index 7994369..046f44c 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/ci.yml @@ -1,24 +1,54 @@ -name: Lint +name: CI + on: push: - tags: - - v* branches: - - master - - main + - main + - master + tags: + - v* + pull_request: + +permissions: + contents: read + jobs: - golangci: - name: lint + + build: + name: Build + runs-on: ubuntu-latest + steps: + - + name: Check out code + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 + - + name: Set up Go + uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 + with: + go-version-file: 'go.mod' + id: go + - + name: Build + run: go build -v . + - + name: Test + run: go test -v ./... + + lint: + name: Lint runs-on: ubuntu-latest steps: - - name: Checkout code + - + name: Checkout code uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 - - name: Set up Go + - + name: Set up Go uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 with: go-version-file: 'go.mod' - - name: golangci-lint + - + name: golangci-lint uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0 with: # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index eebae81..4fdd69a 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -2,15 +2,14 @@ name: Docker on: push: - # Publish `master` as Docker `latest` image. branches: - - master + - main + - master # Publish `v1.2.3` tags as releases. tags: - - v* + - v* pull_request: - branches: [ master ] env: REGISTRY: ghcr.io diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml deleted file mode 100644 index afe93d0..0000000 --- a/.github/workflows/go.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Go - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - - build: - name: Build - runs-on: ubuntu-latest - steps: - - - name: Check out code - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 - - - name: Set up Go - uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 - with: - go-version-file: 'go.mod' - - id: go - - - name: Build - run: go build -v . - - - name: Test - run: go test -v ./...