From bd8e454aaf3487afd75ebd46c306f2838dde1770 Mon Sep 17 00:00:00 2001 From: Marc Binz Date: Thu, 2 May 2024 22:35:29 +0200 Subject: [PATCH] ci: optimise workflows and renovate setup (#261) --- .github/renovate.json | 37 +++++++++-------------- .github/workflows/pull_request.yml | 48 ------------------------------ 2 files changed, 14 insertions(+), 71 deletions(-) diff --git a/.github/renovate.json b/.github/renovate.json index bd668b3e..7f93b640 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -1,46 +1,37 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "timezone": "Europe/Berlin", - "labels": ["cc | build"], "packageRules": [ { - "matchPackagePatterns": ["github-actions"], + "matchPackagePatterns": ["action"], "groupName": "workflow updates", - "commitMessage": "ci: apply workflow version updates", + "commitMessage": "ci: apply workflow updates", "labels": ["cc | ci"], - "schedule": ["after 7am before 9am"] + "schedule": ["after 7am before 9am on Monday"] }, { "matchDatasources": ["golang-version"], "groupName": "go version update", - "labels": ["cc | build"], - "commitMessage": "build: update go version {{{commitMessageExtra}}}", - "schedule": ["after 7am before 9am"] + "labels": ["cc | test"], + "commitMessage": "build(go): update language version {{{commitMessageExtra}}}", + "schedule": ["after 7am before 9am on Monday"] }, { "matchDatasources": ["go"], - "matchUpdateTypes": ["major"], - "stabilityDays": 3, - "groupName": "go major package updates", - "commitMessage": "build: apply major go package updates", - "labels": ["cc | build"], - "schedule": ["after 7am before 9am"] - }, - { - "matchDatasources": ["go"], - "matchUpdateTypes": ["minor", "patch"], + "matchUpdateTypes": ["minor", "patch", "pin", "pinDigest", "digest", "lockFileMaintenance", "rollback", "bump"], "groupName": "go minor/patch package updates", - "commitMessage": "build: apply minor/patch go package updates", + "commitMessage": "build(go): apply minor/patch package updates", "labels": ["cc | build"], - "schedule": ["after 7am before 9am"] + "schedule": ["after 7am before 9am on Monday"] }, { "matchDatasources": ["go"], - "matchUpdateTypes": ["pin", "pinDigest", "digest", "lockFileMaintenance", "rollback", "bump"], - "groupName": "go other package updates", - "commitMessage": "build: apply other go package updates", + "matchUpdateTypes": ["major"], + "minimumReleaseAge": "3 days", + "groupName": "go major package updates", + "commitMessage": "build(go): apply major package updates", "labels": ["cc | build"], - "schedule": ["after 7am before 9am on saturday"] + "schedule": ["after 7am before 9am on Monday"] } ], "additionalReviewers": ["marcbinz"], diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index a4647394..e85d4cd2 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -44,18 +44,6 @@ jobs: - name: Check Go Version run: go version - - name: Cache Go Modules - uses: actions/cache@v3 - env: - cache-name: cache-go-modules - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.OS }}-build-${{ env.cache-name }}- - ${{ runner.OS }}-build- - ${{ runner.OS }}- - - name: Sync working-directory: . run: go mod download @@ -91,18 +79,6 @@ jobs: - name: Check Go Version run: go version - - name: Cache Go Modules - uses: actions/cache@v3 - env: - cache-name: cache-go-modules - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.OS }}-build-${{ env.cache-name }}- - ${{ runner.OS }}-build- - ${{ runner.OS }}- - - name: Lint uses: golangci/golangci-lint-action@v3 with: @@ -141,18 +117,6 @@ jobs: - name: Check Go Version run: go version - - name: Cache Go Modules - uses: actions/cache@v3 - env: - cache-name: cache-go-modules - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.OS }}-build-${{ env.cache-name }}- - ${{ runner.OS }}-build- - ${{ runner.OS }}- - - name: Build working-directory: cmd/somgen run: go build -v ./... @@ -181,18 +145,6 @@ jobs: - name: Check Go Version run: go version - - name: Cache Go Modules - uses: actions/cache@v3 - env: - cache-name: cache-go-modules - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.OS }}-build-${{ env.cache-name }}- - ${{ runner.OS }}-build- - ${{ runner.OS }}- - - name: Test Library working-directory: . run: go test -v ./...