From 6fdc5f0599efae753019edfcbe9561ad2b944658 Mon Sep 17 00:00:00 2001 From: wolmi Date: Thu, 5 Oct 2023 10:56:11 +0200 Subject: [PATCH] feat: Add Actions (#11) * feat: Add renovate * feat: adde labeler and lint --- .github/workflows/labeler.yml | 10 ++++++++++ .github/workflows/lint.yml | 32 ++++++++++++++++++++++++++++++++ .golangci.yml | 19 +++++++++++++++++++ renovate.json | 10 ++++++++++ 4 files changed, 71 insertions(+) create mode 100644 .github/workflows/labeler.yml create mode 100644 .github/workflows/lint.yml create mode 100644 .golangci.yml create mode 100644 renovate.json diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 0000000..f30193d --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,10 @@ +name: size-label +on: pull_request +jobs: + size-label: + runs-on: ubuntu-latest + steps: + - name: size-label + uses: "codelytv/pr-size-labeler@v1" + with: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..aa5077e --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,32 @@ +name: Lint + +on: + pull_request: + types: + - opened + - reopened + - synchronize + - ready_for_review + branches: + - "main" + paths: + - '**.go' + - 'go.*' + - '.github/workflows/lint.yml' + - '.golangci.yml' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + golangci-lint: + if: github.event.pull_request.draft == false + name: runner / golangci-lint + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - name: golangci-lint + uses: reviewdog/action-golangci-lint@v2 + with: + tool_name: golangci-lint diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..b6a224f --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,19 @@ +linters: + enable: + - errcheck + - gochecknoinits +# We don't use goconst because it gives false positives in the tests. +# - goconst + - gofmt + - revive + - gosec + - gosimple + - ineffassign + - staticcheck + - typecheck + - unconvert + - unused + - vet + - vetshadow +run: + timeout: 10m diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..911ba6e --- /dev/null +++ b/renovate.json @@ -0,0 +1,10 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "draftPR": true, + "extends": [ + "config:base", + ":semanticCommits" + ], + "labels": ["dependencies"], + "ignorePaths": ["**/charts/**"] +}