Skip to content

Commit

Permalink
Update linters and workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacome committed Aug 23, 2024
1 parent 2b22e54 commit 49267cf
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 75 deletions.
30 changes: 0 additions & 30 deletions .github/dependabot.yml

This file was deleted.

22 changes: 0 additions & 22 deletions .github/labeler.yml

This file was deleted.

5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Build binary
uses: goreleaser/goreleaser-action@v6
with:
version: latest
version: v2.2.0 # renovate: datasource=github-tags depName=goreleaser/goreleaser
args: build --clean ${{ !startsWith(github.ref, 'refs/tags/') && '--snapshot' || '' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -123,6 +123,7 @@ jobs:
image: ghcr.io/nginxinc/kic-test-${{ matrix.type }}-server:${{ steps.meta.outputs.version }}
only-fixed: true
add-cpes-if-none: true

- name: upload Anchore scan SARIF report
uses: github/codeql-action/upload-sarif@v3
with:
Expand Down Expand Up @@ -189,6 +190,7 @@ jobs:
image: ghcr.io/nginxinc/kic-test-grpc-server:${{ steps.meta.outputs.version }}
only-fixed: true
add-cpes-if-none: true

- name: upload Anchore scan SARIF report
uses: github/codeql-action/upload-sarif@v3
with:
Expand Down Expand Up @@ -255,6 +257,7 @@ jobs:
image: ghcr.io/nginxinc/kic-test-dos-server:${{ steps.meta.outputs.version }}
only-fixed: true
add-cpes-if-none: true

- name: upload Anchore scan SARIF report
uses: github/codeql-action/upload-sarif@v3
with:
Expand Down
15 changes: 0 additions & 15 deletions .github/workflows/dependabot-auto-merge.yml

This file was deleted.

10 changes: 9 additions & 1 deletion .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@ jobs:
pull-requests: write # for actions/labeler to add labels
runs-on: ubuntu-24.04
steps:
- uses: actions/[email protected]
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
sparse-checkout: |
labeler.yml
sparse-checkout-cone-mode: false
repository: nginxinc/k8s-common

- uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
sync-labels: true
configuration-path: labeler.yml
6 changes: 4 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Setup Golang Environment
uses: actions/setup-go@v5
with:
go-version-file: go.mod
go-version: stable

- name: Lint Code
uses: golangci/golangci-lint-action@v6
with:
only-new-issues: true
version: v1.60.1 # renovate: datasource=github-tags depName=golangci/golangci-lint

actionlint:
name: Actionlint
Expand Down
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ linters:
- asciicheck
- bidichk
- contextcheck
- copyloopvar
- dupword
- durationcheck
- err113
- errcheck
- errchkjson
- errname
- errorlint
- exportloopref
- fatcontext
- forcetypeassert
- gocheckcompilerdirectives
Expand Down
3 changes: 3 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ repos:
- id: check-symlinks
- id: check-case-conflict
- id: check-vcs-permalinks
- id: check-json
- id: pretty-format-json
args: [--autofix, --no-ensure-ascii]
- id: mixed-line-ending
args: [--fix=lf]
- id: name-tests-test
Expand Down
9 changes: 6 additions & 3 deletions grpc/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# syntax=docker/dockerfile:1.9
FROM golang:1.23 AS builder

RUN git clone -b v1.65.0 --depth 1 https://github.com/grpc/grpc-go
WORKDIR /go/grpc-go/examples
RUN CGO_ENABLED=0 go build -C helloworld/greeter_server -o /greeter_server
# renovate: datasource=github-releases depName=grpc/grpc-go
ARG GRPC_GO_VERSION=v1.65.0

ADD https://github.com/grpc/grpc-go.git#${GRPC_GO_VERSION} /grpc-go

RUN CGO_ENABLED=0 go build -C /grpc-go/examples/helloworld/greeter_server -o /greeter_server

FROM scratch
COPY --from=builder /greeter_server /
Expand Down
7 changes: 7 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"github>nginxinc/k8s-common",
"schedule:monthly"
]
}

0 comments on commit 49267cf

Please sign in to comment.