From d1f4040009a4de5d37d157794ba659062a244ab1 Mon Sep 17 00:00:00 2001 From: Kordian Bruck Date: Sun, 22 Sep 2024 20:21:58 +0200 Subject: [PATCH 1/6] Configure renovate for keeping dependencies updated --- renovate.json | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 renovate.json diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..202e355 --- /dev/null +++ b/renovate.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "config:base", + "group:allNonMajor" + ], + "ignoreDeps": [] +} \ No newline at end of file From f2422205a77c78887a2c55736e7dde4326d59cb1 Mon Sep 17 00:00:00 2001 From: Kordian Bruck Date: Sun, 22 Sep 2024 20:22:07 +0200 Subject: [PATCH 2/6] Add a PR template. --- .github/pull_request_template.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..fb7ef2d --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,12 @@ +### Motivation and Context + + + +### Description + + +### Steps for Testing + + +### Screenshots + \ No newline at end of file From de14e8f77616efe442ad9e645f496200746f005d Mon Sep 17 00:00:00 2001 From: Kordian Bruck Date: Sun, 22 Sep 2024 20:22:29 +0200 Subject: [PATCH 3/6] Configure lint CI and refresh the build/test steps. --- .../workflows/{go.yml => go-build-test.yml} | 11 +++----- .github/workflows/golangci-lint.yml | 26 +++++++++++++++++++ 2 files changed, 30 insertions(+), 7 deletions(-) rename .github/workflows/{go.yml => go-build-test.yml} (80%) create mode 100644 .github/workflows/golangci-lint.yml diff --git a/.github/workflows/go.yml b/.github/workflows/go-build-test.yml similarity index 80% rename from .github/workflows/go.yml rename to .github/workflows/go-build-test.yml index 03233ed..a2d11b6 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go-build-test.yml @@ -2,25 +2,22 @@ name: Go on: push: - branches: [ master ] + branches: + - main + - master pull_request: - branches: [ master ] jobs: - build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up Go uses: actions/setup-go@v5 with: cache-dependency-path: './go.sum' go-version-file: './go.mod' - - name: Build run: go build -v ./... - - name: Test - run: go test -v ./... + run: go test -v ./... \ No newline at end of file diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml new file mode 100644 index 0000000..938397c --- /dev/null +++ b/.github/workflows/golangci-lint.yml @@ -0,0 +1,26 @@ +name: golangci-lint +on: + push: + branches: + - main + - master + pull_request: + +permissions: + contents: read + # Optional: allow read access to pull request. Use with `only-new-issues` option. + # pull-requests: read + +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: stable + - name: golangci-lint + uses: golangci/golangci-lint-action@v6 + with: + version: v1.60 \ No newline at end of file From 13f570e5a02301424427d04310d156d64256631d Mon Sep 17 00:00:00 2001 From: Kordian Bruck Date: Sun, 22 Sep 2024 20:28:00 +0200 Subject: [PATCH 4/6] Swap renovate for gh native dependabot instead as its easier to activate. --- .github/dependabot.yml | 15 +++++++++++++++ renovate.json | 8 -------- 2 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 .github/dependabot.yml delete mode 100644 renovate.json diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..ad58f45 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,15 @@ +version: 2 +# See https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates for options +updates: + - package-ecosystem: "gomod" + directory: "/" # Location of package manifests + schedule: + interval: "monthly" + - package-ecosystem: "docker" + directory: "/" # Location of package manifests + schedule: + interval: "monthly" + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" \ No newline at end of file diff --git a/renovate.json b/renovate.json deleted file mode 100644 index 202e355..0000000 --- a/renovate.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": [ - "config:base", - "group:allNonMajor" - ], - "ignoreDeps": [] -} \ No newline at end of file From 41bc5e218785d53d69f9dd8546a84607e8ddbb1a Mon Sep 17 00:00:00 2001 From: Kordian Bruck Date: Sun, 22 Sep 2024 20:32:41 +0200 Subject: [PATCH 5/6] Ignore existing issues and annotate the code in the PR diff for better visibility. --- .github/workflows/golangci-lint.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 938397c..00fbab3 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -9,7 +9,9 @@ on: permissions: contents: read # Optional: allow read access to pull request. Use with `only-new-issues` option. - # pull-requests: read + pull-requests: read + # Optional: allow write access to checks to allow the action to annotate code in the PR. + checks: write jobs: golangci: @@ -23,4 +25,5 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v6 with: - version: v1.60 \ No newline at end of file + version: v1.60 + only-new-issues: true \ No newline at end of file From 122946bc6a148b8201be3aab80d97cfffc974797 Mon Sep 17 00:00:00 2001 From: Kordian Bruck Date: Sun, 22 Sep 2024 20:33:41 +0200 Subject: [PATCH 6/6] Improve name for the main workflow. --- .github/workflows/go-build-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go-build-test.yml b/.github/workflows/go-build-test.yml index a2d11b6..566599f 100644 --- a/.github/workflows/go-build-test.yml +++ b/.github/workflows/go-build-test.yml @@ -1,4 +1,4 @@ -name: Go +name: Go Build and Test on: push: