From 6135b904a26d7e4c737cc907108ac5b0e79b6f1c Mon Sep 17 00:00:00 2001 From: silverwind Date: Wed, 5 Jun 2024 20:47:27 +0200 Subject: [PATCH 01/15] Use cache for go lint actions --- .github/workflows/pull-compliance.yml | 71 +++++++++++++++++++++++---- 1 file changed, 61 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pull-compliance.yml b/.github/workflows/pull-compliance.yml index f89276fe82a1b..db45ff4c66a8b 100644 --- a/.github/workflows/pull-compliance.yml +++ b/.github/workflows/pull-compliance.yml @@ -21,10 +21,27 @@ jobs: with: go-version-file: go.mod check-latest: true - - run: make deps-backend deps-tools - - run: make lint-backend + - run: make deps-backend + - uses: actions/cache/restore@v4 + with: + path: | + ~/.cache/golangci-lint + ~/.cache/gopls + key: golangci-v1.59.0-linux-${{ runner.arch }}-${{hashFiles('go.mod')}} env: - TAGS: bindata sqlite sqlite_unlock_notify + GOOS: linux + - uses: golangci/golangci-lint-action@v6 + with: + version: v1.59.0 + skip-cache: true + args: --build-tags bindata,sqlite,sqlite_unlock_notify + - run: make lint-go-vet lint-go-gopls lint-editorconfig + - uses: actions/cache/save@v4 + with: + path: | + ~/.cache/golangci-lint + ~/.cache/gopls + key: golangci-v1.59.0-linux-${{ runner.arch }}-${{hashFiles('go.mod')}} lint-templates: if: needs.files-changed.outputs.templates == 'true' @@ -94,12 +111,28 @@ jobs: with: go-version-file: go.mod check-latest: true - - run: make deps-backend deps-tools - - run: make lint-go-windows lint-go-vet + - run: make deps-backend + - uses: actions/cache/restore@v4 + with: + path: | + ~/.cache/golangci-lint + ~/.cache/gopls + key: golangci-v1.59.0-windows-${{ runner.arch }}-${{hashFiles('go.mod')}} env: - TAGS: bindata sqlite sqlite_unlock_notify GOOS: windows - GOARCH: amd64 + - uses: golangci/golangci-lint-action@v6 + with: + version: v1.59.0 + skip-cache: true + args: --build-tags bindata,sqlite,sqlite_unlock_notify + env: + GOOS: windows + - uses: actions/cache/save@v4 + with: + path: | + ~/.cache/golangci-lint + ~/.cache/gopls + key: golangci-v1.59.0-windows-${{ runner.arch }}-${{hashFiles('go.mod')}} lint-go-gogit: if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' @@ -111,10 +144,28 @@ jobs: with: go-version-file: go.mod check-latest: true - - run: make deps-backend deps-tools - - run: make lint-go + - run: make deps-backend + - uses: actions/cache/restore@v4 + with: + path: | + ~/.cache/golangci-lint + ~/.cache/gopls + key: golangci-v1.59.0-linux-gogit-${{ runner.arch }}-${{hashFiles('go.mod')}} env: - TAGS: bindata gogit sqlite sqlite_unlock_notify + GOOS: linux + - uses: golangci/golangci-lint-action@v6 + with: + version: v1.59.0 + skip-cache: true + args: --build-tags gogit,bindata,sqlite,sqlite_unlock_notify + env: + GOOS: linux + - uses: actions/cache/save@v4 + with: + path: | + ~/.cache/golangci-lint + ~/.cache/gopls + key: golangci-v1.59.0-linux-gogit-${{ runner.arch }}-${{hashFiles('go.mod')}} checks-backend: if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' From be14784f04f9a142a8e307de893c13535344e4c7 Mon Sep 17 00:00:00 2001 From: silverwind Date: Wed, 5 Jun 2024 21:17:00 +0200 Subject: [PATCH 02/15] stop using golangci-lint-action --- .github/workflows/pull-compliance.yml | 45 ++++++++++----------------- 1 file changed, 16 insertions(+), 29 deletions(-) diff --git a/.github/workflows/pull-compliance.yml b/.github/workflows/pull-compliance.yml index db45ff4c66a8b..d1e0c29fa218e 100644 --- a/.github/workflows/pull-compliance.yml +++ b/.github/workflows/pull-compliance.yml @@ -21,27 +21,22 @@ jobs: with: go-version-file: go.mod check-latest: true - - run: make deps-backend + - run: make deps-backend deps-tools - uses: actions/cache/restore@v4 with: path: | ~/.cache/golangci-lint ~/.cache/gopls - key: golangci-v1.59.0-linux-${{ runner.arch }}-${{hashFiles('go.mod')}} + key: ${{env.GITHUB_WORKFLOW}}-linux-${{env.RUNNER_ARCH}}-${{hashFiles('go.mod', 'Makefile')}} + - run: make lint-backend env: - GOOS: linux - - uses: golangci/golangci-lint-action@v6 - with: - version: v1.59.0 - skip-cache: true - args: --build-tags bindata,sqlite,sqlite_unlock_notify - - run: make lint-go-vet lint-go-gopls lint-editorconfig + TAGS: bindata sqlite sqlite_unlock_notify - uses: actions/cache/save@v4 with: path: | ~/.cache/golangci-lint ~/.cache/gopls - key: golangci-v1.59.0-linux-${{ runner.arch }}-${{hashFiles('go.mod')}} + key: ${{env.GITHUB_WORKFLOW}}-linux-${{env.RUNNER_ARCH}}-${{hashFiles('go.mod', 'Makefile')}} lint-templates: if: needs.files-changed.outputs.templates == 'true' @@ -111,28 +106,24 @@ jobs: with: go-version-file: go.mod check-latest: true - - run: make deps-backend + - run: make deps-backend deps-tools - uses: actions/cache/restore@v4 with: path: | ~/.cache/golangci-lint ~/.cache/gopls - key: golangci-v1.59.0-windows-${{ runner.arch }}-${{hashFiles('go.mod')}} - env: - GOOS: windows - - uses: golangci/golangci-lint-action@v6 - with: - version: v1.59.0 - skip-cache: true - args: --build-tags bindata,sqlite,sqlite_unlock_notify + key: ${{env.GITHUB_WORKFLOW}}-linux-${{env.RUNNER_ARCH}}-${{hashFiles('go.mod', 'Makefile')}} + - run: make lint-go-windows lint-go-vet env: + TAGS: bindata sqlite sqlite_unlock_notify GOOS: windows + GOARCH: amd64 - uses: actions/cache/save@v4 with: path: | ~/.cache/golangci-lint ~/.cache/gopls - key: golangci-v1.59.0-windows-${{ runner.arch }}-${{hashFiles('go.mod')}} + key: ${{env.GITHUB_WORKFLOW}}-linux-${{env.RUNNER_ARCH}}-${{hashFiles('go.mod', 'Makefile')}} lint-go-gogit: if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' @@ -144,28 +135,24 @@ jobs: with: go-version-file: go.mod check-latest: true - - run: make deps-backend + - run: make deps-backend deps-tools - uses: actions/cache/restore@v4 with: path: | ~/.cache/golangci-lint ~/.cache/gopls - key: golangci-v1.59.0-linux-gogit-${{ runner.arch }}-${{hashFiles('go.mod')}} + key: ${{env.GITHUB_WORKFLOW}}-linux-${{env.RUNNER_ARCH}}-${{hashFiles('go.mod', 'Makefile')}} env: GOOS: linux - - uses: golangci/golangci-lint-action@v6 - with: - version: v1.59.0 - skip-cache: true - args: --build-tags gogit,bindata,sqlite,sqlite_unlock_notify + - run: make lint-go env: - GOOS: linux + TAGS: bindata gogit sqlite sqlite_unlock_notify - uses: actions/cache/save@v4 with: path: | ~/.cache/golangci-lint ~/.cache/gopls - key: golangci-v1.59.0-linux-gogit-${{ runner.arch }}-${{hashFiles('go.mod')}} + key: ${{env.GITHUB_WORKFLOW}}-linux-${{env.RUNNER_ARCH}}-${{hashFiles('go.mod', 'Makefile')}} checks-backend: if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' From 7968022198abfe9ff183be924f81aed98ca9de83 Mon Sep 17 00:00:00 2001 From: silverwind Date: Wed, 5 Jun 2024 21:31:12 +0200 Subject: [PATCH 03/15] fix keys --- .github/workflows/pull-compliance.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pull-compliance.yml b/.github/workflows/pull-compliance.yml index d1e0c29fa218e..6f69be2afe113 100644 --- a/.github/workflows/pull-compliance.yml +++ b/.github/workflows/pull-compliance.yml @@ -27,7 +27,7 @@ jobs: path: | ~/.cache/golangci-lint ~/.cache/gopls - key: ${{env.GITHUB_WORKFLOW}}-linux-${{env.RUNNER_ARCH}}-${{hashFiles('go.mod', 'Makefile')}} + key: ${{github.workflow}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile')}} - run: make lint-backend env: TAGS: bindata sqlite sqlite_unlock_notify @@ -36,7 +36,7 @@ jobs: path: | ~/.cache/golangci-lint ~/.cache/gopls - key: ${{env.GITHUB_WORKFLOW}}-linux-${{env.RUNNER_ARCH}}-${{hashFiles('go.mod', 'Makefile')}} + key: ${{github.workflow}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile')}} lint-templates: if: needs.files-changed.outputs.templates == 'true' @@ -112,7 +112,7 @@ jobs: path: | ~/.cache/golangci-lint ~/.cache/gopls - key: ${{env.GITHUB_WORKFLOW}}-linux-${{env.RUNNER_ARCH}}-${{hashFiles('go.mod', 'Makefile')}} + key: ${{github.workflow}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile')}} - run: make lint-go-windows lint-go-vet env: TAGS: bindata sqlite sqlite_unlock_notify @@ -123,7 +123,7 @@ jobs: path: | ~/.cache/golangci-lint ~/.cache/gopls - key: ${{env.GITHUB_WORKFLOW}}-linux-${{env.RUNNER_ARCH}}-${{hashFiles('go.mod', 'Makefile')}} + key: ${{github.workflow}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile')}} lint-go-gogit: if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' @@ -141,7 +141,7 @@ jobs: path: | ~/.cache/golangci-lint ~/.cache/gopls - key: ${{env.GITHUB_WORKFLOW}}-linux-${{env.RUNNER_ARCH}}-${{hashFiles('go.mod', 'Makefile')}} + key: ${{github.workflow}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile')}} env: GOOS: linux - run: make lint-go @@ -152,7 +152,7 @@ jobs: path: | ~/.cache/golangci-lint ~/.cache/gopls - key: ${{env.GITHUB_WORKFLOW}}-linux-${{env.RUNNER_ARCH}}-${{hashFiles('go.mod', 'Makefile')}} + key: ${{github.workflow}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile')}} checks-backend: if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' From d7cc20deb4dfad1661788ba9e93ede32149ed730 Mon Sep 17 00:00:00 2001 From: silverwind Date: Wed, 5 Jun 2024 21:48:16 +0200 Subject: [PATCH 04/15] really fix key --- .github/workflows/pull-compliance.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pull-compliance.yml b/.github/workflows/pull-compliance.yml index 6f69be2afe113..5f171e4e4acde 100644 --- a/.github/workflows/pull-compliance.yml +++ b/.github/workflows/pull-compliance.yml @@ -27,7 +27,7 @@ jobs: path: | ~/.cache/golangci-lint ~/.cache/gopls - key: ${{github.workflow}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile')}} + key: ${{github.job}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile')}} - run: make lint-backend env: TAGS: bindata sqlite sqlite_unlock_notify @@ -36,7 +36,7 @@ jobs: path: | ~/.cache/golangci-lint ~/.cache/gopls - key: ${{github.workflow}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile')}} + key: ${{github.job}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile')}} lint-templates: if: needs.files-changed.outputs.templates == 'true' @@ -112,7 +112,7 @@ jobs: path: | ~/.cache/golangci-lint ~/.cache/gopls - key: ${{github.workflow}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile')}} + key: ${{github.job}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile')}} - run: make lint-go-windows lint-go-vet env: TAGS: bindata sqlite sqlite_unlock_notify @@ -123,7 +123,7 @@ jobs: path: | ~/.cache/golangci-lint ~/.cache/gopls - key: ${{github.workflow}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile')}} + key: ${{github.job}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile')}} lint-go-gogit: if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' @@ -141,7 +141,7 @@ jobs: path: | ~/.cache/golangci-lint ~/.cache/gopls - key: ${{github.workflow}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile')}} + key: ${{github.job}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile')}} env: GOOS: linux - run: make lint-go @@ -152,7 +152,7 @@ jobs: path: | ~/.cache/golangci-lint ~/.cache/gopls - key: ${{github.workflow}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile')}} + key: ${{github.job}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile')}} checks-backend: if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' From fa2d25dcf54d31a709c3815eb369d1474040f4ee Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 6 Jun 2024 00:11:06 +0200 Subject: [PATCH 05/15] also add go-build cache --- .github/workflows/pull-compliance.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pull-compliance.yml b/.github/workflows/pull-compliance.yml index 5f171e4e4acde..7c9af1b8832b2 100644 --- a/.github/workflows/pull-compliance.yml +++ b/.github/workflows/pull-compliance.yml @@ -27,7 +27,8 @@ jobs: path: | ~/.cache/golangci-lint ~/.cache/gopls - key: ${{github.job}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile')}} + ~/.cache/go-build + key: golint-v1-${{github.job}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile')}} - run: make lint-backend env: TAGS: bindata sqlite sqlite_unlock_notify @@ -36,7 +37,8 @@ jobs: path: | ~/.cache/golangci-lint ~/.cache/gopls - key: ${{github.job}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile')}} + ~/.cache/go-build + key: golint-v1-${{github.job}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile')}} lint-templates: if: needs.files-changed.outputs.templates == 'true' @@ -112,7 +114,8 @@ jobs: path: | ~/.cache/golangci-lint ~/.cache/gopls - key: ${{github.job}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile')}} + ~/.cache/go-build + key: golint-v1-${{github.job}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile')}} - run: make lint-go-windows lint-go-vet env: TAGS: bindata sqlite sqlite_unlock_notify @@ -123,7 +126,8 @@ jobs: path: | ~/.cache/golangci-lint ~/.cache/gopls - key: ${{github.job}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile')}} + ~/.cache/go-build + key: golint-v1-${{github.job}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile')}} lint-go-gogit: if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' @@ -141,7 +145,8 @@ jobs: path: | ~/.cache/golangci-lint ~/.cache/gopls - key: ${{github.job}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile')}} + ~/.cache/go-build + key: golint-v1-${{github.job}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile')}} env: GOOS: linux - run: make lint-go @@ -152,7 +157,8 @@ jobs: path: | ~/.cache/golangci-lint ~/.cache/gopls - key: ${{github.job}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile')}} + ~/.cache/go-build + key: golint-v1-${{github.job}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile')}} checks-backend: if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' From d2363f90af13364b543188540ba8bf9edb2da957 Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 6 Jun 2024 00:31:41 +0200 Subject: [PATCH 06/15] add more dependency files to cache key --- .github/workflows/pull-compliance.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pull-compliance.yml b/.github/workflows/pull-compliance.yml index 7c9af1b8832b2..8f38256f12e7d 100644 --- a/.github/workflows/pull-compliance.yml +++ b/.github/workflows/pull-compliance.yml @@ -28,7 +28,7 @@ jobs: ~/.cache/golangci-lint ~/.cache/gopls ~/.cache/go-build - key: golint-v1-${{github.job}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile')}} + key: golint-v1-${{github.job}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile', '.golangci.yml', 'tools/lint-go-gopls.sh')}} - run: make lint-backend env: TAGS: bindata sqlite sqlite_unlock_notify @@ -38,7 +38,7 @@ jobs: ~/.cache/golangci-lint ~/.cache/gopls ~/.cache/go-build - key: golint-v1-${{github.job}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile')}} + key: golint-v1-${{github.job}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile', '.golangci.yml', 'tools/lint-go-gopls.sh')}} lint-templates: if: needs.files-changed.outputs.templates == 'true' @@ -115,7 +115,7 @@ jobs: ~/.cache/golangci-lint ~/.cache/gopls ~/.cache/go-build - key: golint-v1-${{github.job}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile')}} + key: golint-v1-${{github.job}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile', '.golangci.yml', 'tools/lint-go-gopls.sh')}} - run: make lint-go-windows lint-go-vet env: TAGS: bindata sqlite sqlite_unlock_notify @@ -127,7 +127,7 @@ jobs: ~/.cache/golangci-lint ~/.cache/gopls ~/.cache/go-build - key: golint-v1-${{github.job}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile')}} + key: golint-v1-${{github.job}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile', '.golangci.yml', 'tools/lint-go-gopls.sh')}} lint-go-gogit: if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' @@ -146,7 +146,7 @@ jobs: ~/.cache/golangci-lint ~/.cache/gopls ~/.cache/go-build - key: golint-v1-${{github.job}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile')}} + key: golint-v1-${{github.job}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile', '.golangci.yml', 'tools/lint-go-gopls.sh')}} env: GOOS: linux - run: make lint-go @@ -158,7 +158,7 @@ jobs: ~/.cache/golangci-lint ~/.cache/gopls ~/.cache/go-build - key: golint-v1-${{github.job}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile')}} + key: golint-v1-${{github.job}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile', '.golangci.yml', 'tools/lint-go-gopls.sh')}} checks-backend: if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' From 7138cc5421347ffafa88345e8d4e9d375fff1d00 Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 6 Jun 2024 01:04:37 +0200 Subject: [PATCH 07/15] add reusable workflows, cache GOMODCACHE as well --- .github/workflows/cache-golint-restore.yml | 26 +++++++++++ .github/workflows/cache-golint-save.yml | 28 +++++++++++ .github/workflows/pull-compliance.yml | 54 ++++++---------------- 3 files changed, 69 insertions(+), 39 deletions(-) create mode 100644 .github/workflows/cache-golint-restore.yml create mode 100644 .github/workflows/cache-golint-save.yml diff --git a/.github/workflows/cache-golint-restore.yml b/.github/workflows/cache-golint-restore.yml new file mode 100644 index 0000000000000..7af3ef2f0e87f --- /dev/null +++ b/.github/workflows/cache-golint-restore.yml @@ -0,0 +1,26 @@ +name: cache-golint-restore + +on: + workflow_call: + inputs: + job: + type: string + required: true + +jobs: + restore: + runs-on: ubuntu-latest + steps: + - id: vars + run: | + echo "::set-output name=GOCACHE::$(go env GOCACHE)" + echo "::set-output name=GOMODCACHE::$(go env GOMODCACHE)" + echo "::set-output name=GOVERSION::$(go env GOVERSION)" + - uses: actions/cache/restore@v4 + with: + path: | + ~/.cache/golangci-lint + ~/.cache/gopls + ${{steps.vars.outputs.GOCACHE}} + ${{steps.vars.outputs.GOMODCACHE}} + key: golint-v1-${{ inputs.job }}-${{ runner.os }}-${{ runner.arch }}-${{ steps.vars.outputs.GOVERSION }}-${{ hashFiles('go.mod', 'Makefile', '.golangci.yml', 'tools/lint-go-gopls.sh') }} diff --git a/.github/workflows/cache-golint-save.yml b/.github/workflows/cache-golint-save.yml new file mode 100644 index 0000000000000..0ef471191ceed --- /dev/null +++ b/.github/workflows/cache-golint-save.yml @@ -0,0 +1,28 @@ +name: cache-golint-save + +on: + workflow_call: + inputs: + job: + type: string + required: true + +jobs: + save: + runs-on: ubuntu-latest + steps: + - id: vars + run: | + echo "::set-output name=GOCACHE::$(go env GOCACHE)" + echo "::set-output name=GOMODCACHE::$(go env GOMODCACHE)" + echo "::set-output name=GOVERSION::$(go env GOVERSION)" + - uses: actions/cache/save@v4 + with: + path: | + ~/.cache/golangci-lint + ~/.cache/gopls + ${{steps.vars.outputs.GOCACHE}} + ${{steps.vars.outputs.GOMODCACHE}} + key: golint-v1-${{ inputs.job }}-${{ runner.os }}-${{ runner.arch }}-${{ steps.vars.outputs.GOVERSION }}-${{ hashFiles('go.mod', 'Makefile', '.golangci.yml', 'tools/lint-go-gopls.sh') }} + + diff --git a/.github/workflows/pull-compliance.yml b/.github/workflows/pull-compliance.yml index 8f38256f12e7d..d25418eb88b68 100644 --- a/.github/workflows/pull-compliance.yml +++ b/.github/workflows/pull-compliance.yml @@ -21,24 +21,16 @@ jobs: with: go-version-file: go.mod check-latest: true - - run: make deps-backend deps-tools - - uses: actions/cache/restore@v4 + - uses: ./.github/workflows/cache-golint-restore.yml with: - path: | - ~/.cache/golangci-lint - ~/.cache/gopls - ~/.cache/go-build - key: golint-v1-${{github.job}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile', '.golangci.yml', 'tools/lint-go-gopls.sh')}} + job: ${{ github.job }} + - run: make deps-backend deps-tools - run: make lint-backend env: TAGS: bindata sqlite sqlite_unlock_notify - - uses: actions/cache/save@v4 + - uses: ./.github/workflows/cache-golint-save.yml with: - path: | - ~/.cache/golangci-lint - ~/.cache/gopls - ~/.cache/go-build - key: golint-v1-${{github.job}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile', '.golangci.yml', 'tools/lint-go-gopls.sh')}} + job: ${{ github.job }} lint-templates: if: needs.files-changed.outputs.templates == 'true' @@ -108,26 +100,18 @@ jobs: with: go-version-file: go.mod check-latest: true - - run: make deps-backend deps-tools - - uses: actions/cache/restore@v4 + - uses: ./.github/workflows/cache-golint-restore.yml with: - path: | - ~/.cache/golangci-lint - ~/.cache/gopls - ~/.cache/go-build - key: golint-v1-${{github.job}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile', '.golangci.yml', 'tools/lint-go-gopls.sh')}} + job: ${{ github.job }} + - run: make deps-backend deps-tools - run: make lint-go-windows lint-go-vet env: TAGS: bindata sqlite sqlite_unlock_notify GOOS: windows GOARCH: amd64 - - uses: actions/cache/save@v4 + - uses: ./.github/workflows/cache-golint-save.yml with: - path: | - ~/.cache/golangci-lint - ~/.cache/gopls - ~/.cache/go-build - key: golint-v1-${{github.job}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile', '.golangci.yml', 'tools/lint-go-gopls.sh')}} + job: ${{ github.job }} lint-go-gogit: if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' @@ -139,26 +123,18 @@ jobs: with: go-version-file: go.mod check-latest: true - - run: make deps-backend deps-tools - - uses: actions/cache/restore@v4 + - uses: ./.github/workflows/cache-golint-restore.yml with: - path: | - ~/.cache/golangci-lint - ~/.cache/gopls - ~/.cache/go-build - key: golint-v1-${{github.job}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile', '.golangci.yml', 'tools/lint-go-gopls.sh')}} + job: ${{ github.job }} + - run: make deps-backend deps-tools env: GOOS: linux - run: make lint-go env: TAGS: bindata gogit sqlite sqlite_unlock_notify - - uses: actions/cache/save@v4 + - uses: ./.github/workflows/cache-golint-save.yml with: - path: | - ~/.cache/golangci-lint - ~/.cache/gopls - ~/.cache/go-build - key: golint-v1-${{github.job}}-${{runner.os}}-${{runner.arch}}-${{hashFiles('go.mod', 'Makefile', '.golangci.yml', 'tools/lint-go-gopls.sh')}} + job: ${{ github.job }} checks-backend: if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' From bb145f7cc699f0357f0b8e7cb9581c589c0ba314 Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 6 Jun 2024 01:06:08 +0200 Subject: [PATCH 08/15] fix lint --- .github/workflows/cache-golint-save.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/cache-golint-save.yml b/.github/workflows/cache-golint-save.yml index 0ef471191ceed..a0fc5fa6d2de6 100644 --- a/.github/workflows/cache-golint-save.yml +++ b/.github/workflows/cache-golint-save.yml @@ -24,5 +24,3 @@ jobs: ${{steps.vars.outputs.GOCACHE}} ${{steps.vars.outputs.GOMODCACHE}} key: golint-v1-${{ inputs.job }}-${{ runner.os }}-${{ runner.arch }}-${{ steps.vars.outputs.GOVERSION }}-${{ hashFiles('go.mod', 'Makefile', '.golangci.yml', 'tools/lint-go-gopls.sh') }} - - From 09ebbde88016419428a4ed331d9241b9d7903ece Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 6 Jun 2024 01:17:49 +0200 Subject: [PATCH 09/15] fix lint --- .github/workflows/cache-golint-restore.yml | 6 +++--- .github/workflows/cache-golint-save.yml | 6 +++--- Makefile | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cache-golint-restore.yml b/.github/workflows/cache-golint-restore.yml index 7af3ef2f0e87f..d131513629ceb 100644 --- a/.github/workflows/cache-golint-restore.yml +++ b/.github/workflows/cache-golint-restore.yml @@ -13,9 +13,9 @@ jobs: steps: - id: vars run: | - echo "::set-output name=GOCACHE::$(go env GOCACHE)" - echo "::set-output name=GOMODCACHE::$(go env GOMODCACHE)" - echo "::set-output name=GOVERSION::$(go env GOVERSION)" + echo "GOCACHE=$(go env GOCACHE)" >> "$GITHUB_OUTPUT" + echo "GOMODCACHE=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT" + echo "GOVERSION=$(go env GOVERSION)" >> "$GITHUB_OUTPUT" - uses: actions/cache/restore@v4 with: path: | diff --git a/.github/workflows/cache-golint-save.yml b/.github/workflows/cache-golint-save.yml index a0fc5fa6d2de6..43bd3ef9bc09e 100644 --- a/.github/workflows/cache-golint-save.yml +++ b/.github/workflows/cache-golint-save.yml @@ -13,9 +13,9 @@ jobs: steps: - id: vars run: | - echo "::set-output name=GOCACHE::$(go env GOCACHE)" - echo "::set-output name=GOMODCACHE::$(go env GOMODCACHE)" - echo "::set-output name=GOVERSION::$(go env GOVERSION)" + echo "GOCACHE=$(go env GOCACHE)" >> "$GITHUB_OUTPUT" + echo "GOMODCACHE=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT" + echo "GOVERSION=$(go env GOVERSION)" >> "$GITHUB_OUTPUT" - uses: actions/cache/save@v4 with: path: | diff --git a/Makefile b/Makefile index d97360c9f49ec..6873b7d20f6dd 100644 --- a/Makefile +++ b/Makefile @@ -437,7 +437,7 @@ lint-editorconfig: .PHONY: lint-actions lint-actions: - $(GO) run $(ACTIONLINT_PACKAGE) + SHELLCHECK_OPTS='-e SC2129' $(GO) run $(ACTIONLINT_PACKAGE) .PHONY: lint-templates lint-templates: .venv node_modules From 48e04a6c02b4c740ea0a25c62feecdb99b91e21a Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 6 Jun 2024 01:26:14 +0200 Subject: [PATCH 10/15] un-reuse --- .github/workflows/cache-golint-restore.yml | 26 ------- .github/workflows/cache-golint-save.yml | 26 ------- .github/workflows/pull-compliance.yml | 84 ++++++++++++++++++---- 3 files changed, 72 insertions(+), 64 deletions(-) delete mode 100644 .github/workflows/cache-golint-restore.yml delete mode 100644 .github/workflows/cache-golint-save.yml diff --git a/.github/workflows/cache-golint-restore.yml b/.github/workflows/cache-golint-restore.yml deleted file mode 100644 index d131513629ceb..0000000000000 --- a/.github/workflows/cache-golint-restore.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: cache-golint-restore - -on: - workflow_call: - inputs: - job: - type: string - required: true - -jobs: - restore: - runs-on: ubuntu-latest - steps: - - id: vars - run: | - echo "GOCACHE=$(go env GOCACHE)" >> "$GITHUB_OUTPUT" - echo "GOMODCACHE=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT" - echo "GOVERSION=$(go env GOVERSION)" >> "$GITHUB_OUTPUT" - - uses: actions/cache/restore@v4 - with: - path: | - ~/.cache/golangci-lint - ~/.cache/gopls - ${{steps.vars.outputs.GOCACHE}} - ${{steps.vars.outputs.GOMODCACHE}} - key: golint-v1-${{ inputs.job }}-${{ runner.os }}-${{ runner.arch }}-${{ steps.vars.outputs.GOVERSION }}-${{ hashFiles('go.mod', 'Makefile', '.golangci.yml', 'tools/lint-go-gopls.sh') }} diff --git a/.github/workflows/cache-golint-save.yml b/.github/workflows/cache-golint-save.yml deleted file mode 100644 index 43bd3ef9bc09e..0000000000000 --- a/.github/workflows/cache-golint-save.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: cache-golint-save - -on: - workflow_call: - inputs: - job: - type: string - required: true - -jobs: - save: - runs-on: ubuntu-latest - steps: - - id: vars - run: | - echo "GOCACHE=$(go env GOCACHE)" >> "$GITHUB_OUTPUT" - echo "GOMODCACHE=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT" - echo "GOVERSION=$(go env GOVERSION)" >> "$GITHUB_OUTPUT" - - uses: actions/cache/save@v4 - with: - path: | - ~/.cache/golangci-lint - ~/.cache/gopls - ${{steps.vars.outputs.GOCACHE}} - ${{steps.vars.outputs.GOMODCACHE}} - key: golint-v1-${{ inputs.job }}-${{ runner.os }}-${{ runner.arch }}-${{ steps.vars.outputs.GOVERSION }}-${{ hashFiles('go.mod', 'Makefile', '.golangci.yml', 'tools/lint-go-gopls.sh') }} diff --git a/.github/workflows/pull-compliance.yml b/.github/workflows/pull-compliance.yml index d25418eb88b68..e0ddb429369cf 100644 --- a/.github/workflows/pull-compliance.yml +++ b/.github/workflows/pull-compliance.yml @@ -21,16 +21,36 @@ jobs: with: go-version-file: go.mod check-latest: true - - uses: ./.github/workflows/cache-golint-restore.yml + - id: vars + run: | + echo "GOCACHE=$(go env GOCACHE)" >> "$GITHUB_OUTPUT" + echo "GOMODCACHE=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT" + echo "GOVERSION=$(go env GOVERSION)" >> "$GITHUB_OUTPUT" + - uses: actions/cache/restore@v4 with: - job: ${{ github.job }} + path: | + ~/.cache/golangci-lint + ~/.cache/gopls + ${{steps.vars.outputs.GOCACHE}} + ${{steps.vars.outputs.GOMODCACHE}} + key: golint-v1-${{ github.job }}-${{ runner.os }}-${{ runner.arch }}-${{ steps.vars.outputs.GOVERSION }}-${{ hashFiles('go.mod', 'Makefile', '.golangci.yml', 'tools/lint-go-gopls.sh') }} - run: make deps-backend deps-tools - run: make lint-backend env: TAGS: bindata sqlite sqlite_unlock_notify - - uses: ./.github/workflows/cache-golint-save.yml + - id: vars + run: | + echo "GOCACHE=$(go env GOCACHE)" >> "$GITHUB_OUTPUT" + echo "GOMODCACHE=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT" + echo "GOVERSION=$(go env GOVERSION)" >> "$GITHUB_OUTPUT" + - uses: actions/cache/save@v4 with: - job: ${{ github.job }} + path: | + ~/.cache/golangci-lint + ~/.cache/gopls + ${{steps.vars.outputs.GOCACHE}} + ${{steps.vars.outputs.GOMODCACHE}} + key: golint-v1-${{ github.job }}-${{ runner.os }}-${{ runner.arch }}-${{ steps.vars.outputs.GOVERSION }}-${{ hashFiles('go.mod', 'Makefile', '.golangci.yml', 'tools/lint-go-gopls.sh') }} lint-templates: if: needs.files-changed.outputs.templates == 'true' @@ -100,18 +120,38 @@ jobs: with: go-version-file: go.mod check-latest: true - - uses: ./.github/workflows/cache-golint-restore.yml + - id: vars + run: | + echo "GOCACHE=$(go env GOCACHE)" >> "$GITHUB_OUTPUT" + echo "GOMODCACHE=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT" + echo "GOVERSION=$(go env GOVERSION)" >> "$GITHUB_OUTPUT" + - uses: actions/cache/restore@v4 with: - job: ${{ github.job }} + path: | + ~/.cache/golangci-lint + ~/.cache/gopls + ${{steps.vars.outputs.GOCACHE}} + ${{steps.vars.outputs.GOMODCACHE}} + key: golint-v1-${{ github.job }}-${{ runner.os }}-${{ runner.arch }}-${{ steps.vars.outputs.GOVERSION }}-${{ hashFiles('go.mod', 'Makefile', '.golangci.yml', 'tools/lint-go-gopls.sh') }} - run: make deps-backend deps-tools - run: make lint-go-windows lint-go-vet env: TAGS: bindata sqlite sqlite_unlock_notify GOOS: windows GOARCH: amd64 - - uses: ./.github/workflows/cache-golint-save.yml + - id: vars + run: | + echo "GOCACHE=$(go env GOCACHE)" >> "$GITHUB_OUTPUT" + echo "GOMODCACHE=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT" + echo "GOVERSION=$(go env GOVERSION)" >> "$GITHUB_OUTPUT" + - uses: actions/cache/save@v4 with: - job: ${{ github.job }} + path: | + ~/.cache/golangci-lint + ~/.cache/gopls + ${{steps.vars.outputs.GOCACHE}} + ${{steps.vars.outputs.GOMODCACHE}} + key: golint-v1-${{ github.job }}-${{ runner.os }}-${{ runner.arch }}-${{ steps.vars.outputs.GOVERSION }}-${{ hashFiles('go.mod', 'Makefile', '.golangci.yml', 'tools/lint-go-gopls.sh') }} lint-go-gogit: if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' @@ -123,18 +163,38 @@ jobs: with: go-version-file: go.mod check-latest: true - - uses: ./.github/workflows/cache-golint-restore.yml + - id: vars + run: | + echo "GOCACHE=$(go env GOCACHE)" >> "$GITHUB_OUTPUT" + echo "GOMODCACHE=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT" + echo "GOVERSION=$(go env GOVERSION)" >> "$GITHUB_OUTPUT" + - uses: actions/cache/restore@v4 with: - job: ${{ github.job }} + path: | + ~/.cache/golangci-lint + ~/.cache/gopls + ${{steps.vars.outputs.GOCACHE}} + ${{steps.vars.outputs.GOMODCACHE}} + key: golint-v1-${{ github.job }}-${{ runner.os }}-${{ runner.arch }}-${{ steps.vars.outputs.GOVERSION }}-${{ hashFiles('go.mod', 'Makefile', '.golangci.yml', 'tools/lint-go-gopls.sh') }} - run: make deps-backend deps-tools env: GOOS: linux - run: make lint-go env: TAGS: bindata gogit sqlite sqlite_unlock_notify - - uses: ./.github/workflows/cache-golint-save.yml + - id: vars + run: | + echo "GOCACHE=$(go env GOCACHE)" >> "$GITHUB_OUTPUT" + echo "GOMODCACHE=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT" + echo "GOVERSION=$(go env GOVERSION)" >> "$GITHUB_OUTPUT" + - uses: actions/cache/save@v4 with: - job: ${{ github.job }} + path: | + ~/.cache/golangci-lint + ~/.cache/gopls + ${{steps.vars.outputs.GOCACHE}} + ${{steps.vars.outputs.GOMODCACHE}} + key: golint-v1-${{ github.job }}-${{ runner.os }}-${{ runner.arch }}-${{ steps.vars.outputs.GOVERSION }}-${{ hashFiles('go.mod', 'Makefile', '.golangci.yml', 'tools/lint-go-gopls.sh') }} checks-backend: if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' From 8e7206602a59b629d22ebf4b8a1c34d024dec1a8 Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 6 Jun 2024 01:28:40 +0200 Subject: [PATCH 11/15] lint --- .github/workflows/pull-compliance.yml | 39 +++++++++------------------ 1 file changed, 12 insertions(+), 27 deletions(-) diff --git a/.github/workflows/pull-compliance.yml b/.github/workflows/pull-compliance.yml index e0ddb429369cf..650506eb999c3 100644 --- a/.github/workflows/pull-compliance.yml +++ b/.github/workflows/pull-compliance.yml @@ -31,25 +31,20 @@ jobs: path: | ~/.cache/golangci-lint ~/.cache/gopls - ${{steps.vars.outputs.GOCACHE}} - ${{steps.vars.outputs.GOMODCACHE}} + ${{ steps.vars.outputs.GOCACHE }} + ${{ steps.vars.outputs.GOMODCACHE }} key: golint-v1-${{ github.job }}-${{ runner.os }}-${{ runner.arch }}-${{ steps.vars.outputs.GOVERSION }}-${{ hashFiles('go.mod', 'Makefile', '.golangci.yml', 'tools/lint-go-gopls.sh') }} - run: make deps-backend deps-tools - run: make lint-backend env: TAGS: bindata sqlite sqlite_unlock_notify - - id: vars - run: | - echo "GOCACHE=$(go env GOCACHE)" >> "$GITHUB_OUTPUT" - echo "GOMODCACHE=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT" - echo "GOVERSION=$(go env GOVERSION)" >> "$GITHUB_OUTPUT" - uses: actions/cache/save@v4 with: path: | ~/.cache/golangci-lint ~/.cache/gopls - ${{steps.vars.outputs.GOCACHE}} - ${{steps.vars.outputs.GOMODCACHE}} + ${{ steps.vars.outputs.GOCACHE }} + ${{ steps.vars.outputs.GOMODCACHE }} key: golint-v1-${{ github.job }}-${{ runner.os }}-${{ runner.arch }}-${{ steps.vars.outputs.GOVERSION }}-${{ hashFiles('go.mod', 'Makefile', '.golangci.yml', 'tools/lint-go-gopls.sh') }} lint-templates: @@ -130,8 +125,8 @@ jobs: path: | ~/.cache/golangci-lint ~/.cache/gopls - ${{steps.vars.outputs.GOCACHE}} - ${{steps.vars.outputs.GOMODCACHE}} + ${{ steps.vars.outputs.GOCACHE }} + ${{ steps.vars.outputs.GOMODCACHE }} key: golint-v1-${{ github.job }}-${{ runner.os }}-${{ runner.arch }}-${{ steps.vars.outputs.GOVERSION }}-${{ hashFiles('go.mod', 'Makefile', '.golangci.yml', 'tools/lint-go-gopls.sh') }} - run: make deps-backend deps-tools - run: make lint-go-windows lint-go-vet @@ -139,18 +134,13 @@ jobs: TAGS: bindata sqlite sqlite_unlock_notify GOOS: windows GOARCH: amd64 - - id: vars - run: | - echo "GOCACHE=$(go env GOCACHE)" >> "$GITHUB_OUTPUT" - echo "GOMODCACHE=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT" - echo "GOVERSION=$(go env GOVERSION)" >> "$GITHUB_OUTPUT" - uses: actions/cache/save@v4 with: path: | ~/.cache/golangci-lint ~/.cache/gopls - ${{steps.vars.outputs.GOCACHE}} - ${{steps.vars.outputs.GOMODCACHE}} + ${{ steps.vars.outputs.GOCACHE }} + ${{ steps.vars.outputs.GOMODCACHE }} key: golint-v1-${{ github.job }}-${{ runner.os }}-${{ runner.arch }}-${{ steps.vars.outputs.GOVERSION }}-${{ hashFiles('go.mod', 'Makefile', '.golangci.yml', 'tools/lint-go-gopls.sh') }} lint-go-gogit: @@ -173,8 +163,8 @@ jobs: path: | ~/.cache/golangci-lint ~/.cache/gopls - ${{steps.vars.outputs.GOCACHE}} - ${{steps.vars.outputs.GOMODCACHE}} + ${{ steps.vars.outputs.GOCACHE }} + ${{ steps.vars.outputs.GOMODCACHE }} key: golint-v1-${{ github.job }}-${{ runner.os }}-${{ runner.arch }}-${{ steps.vars.outputs.GOVERSION }}-${{ hashFiles('go.mod', 'Makefile', '.golangci.yml', 'tools/lint-go-gopls.sh') }} - run: make deps-backend deps-tools env: @@ -182,18 +172,13 @@ jobs: - run: make lint-go env: TAGS: bindata gogit sqlite sqlite_unlock_notify - - id: vars - run: | - echo "GOCACHE=$(go env GOCACHE)" >> "$GITHUB_OUTPUT" - echo "GOMODCACHE=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT" - echo "GOVERSION=$(go env GOVERSION)" >> "$GITHUB_OUTPUT" - uses: actions/cache/save@v4 with: path: | ~/.cache/golangci-lint ~/.cache/gopls - ${{steps.vars.outputs.GOCACHE}} - ${{steps.vars.outputs.GOMODCACHE}} + ${{ steps.vars.outputs.GOCACHE }} + ${{ steps.vars.outputs.GOMODCACHE }} key: golint-v1-${{ github.job }}-${{ runner.os }}-${{ runner.arch }}-${{ steps.vars.outputs.GOVERSION }}-${{ hashFiles('go.mod', 'Makefile', '.golangci.yml', 'tools/lint-go-gopls.sh') }} checks-backend: From fcb852fd95fad351e766cb79aa5e3215b8ae823e Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 6 Jun 2024 01:44:02 +0200 Subject: [PATCH 12/15] remove GOMODCACHE --- .github/workflows/pull-compliance.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/pull-compliance.yml b/.github/workflows/pull-compliance.yml index 650506eb999c3..844f45a67154e 100644 --- a/.github/workflows/pull-compliance.yml +++ b/.github/workflows/pull-compliance.yml @@ -24,7 +24,6 @@ jobs: - id: vars run: | echo "GOCACHE=$(go env GOCACHE)" >> "$GITHUB_OUTPUT" - echo "GOMODCACHE=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT" echo "GOVERSION=$(go env GOVERSION)" >> "$GITHUB_OUTPUT" - uses: actions/cache/restore@v4 with: @@ -32,7 +31,6 @@ jobs: ~/.cache/golangci-lint ~/.cache/gopls ${{ steps.vars.outputs.GOCACHE }} - ${{ steps.vars.outputs.GOMODCACHE }} key: golint-v1-${{ github.job }}-${{ runner.os }}-${{ runner.arch }}-${{ steps.vars.outputs.GOVERSION }}-${{ hashFiles('go.mod', 'Makefile', '.golangci.yml', 'tools/lint-go-gopls.sh') }} - run: make deps-backend deps-tools - run: make lint-backend @@ -44,7 +42,6 @@ jobs: ~/.cache/golangci-lint ~/.cache/gopls ${{ steps.vars.outputs.GOCACHE }} - ${{ steps.vars.outputs.GOMODCACHE }} key: golint-v1-${{ github.job }}-${{ runner.os }}-${{ runner.arch }}-${{ steps.vars.outputs.GOVERSION }}-${{ hashFiles('go.mod', 'Makefile', '.golangci.yml', 'tools/lint-go-gopls.sh') }} lint-templates: @@ -118,7 +115,6 @@ jobs: - id: vars run: | echo "GOCACHE=$(go env GOCACHE)" >> "$GITHUB_OUTPUT" - echo "GOMODCACHE=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT" echo "GOVERSION=$(go env GOVERSION)" >> "$GITHUB_OUTPUT" - uses: actions/cache/restore@v4 with: @@ -126,7 +122,6 @@ jobs: ~/.cache/golangci-lint ~/.cache/gopls ${{ steps.vars.outputs.GOCACHE }} - ${{ steps.vars.outputs.GOMODCACHE }} key: golint-v1-${{ github.job }}-${{ runner.os }}-${{ runner.arch }}-${{ steps.vars.outputs.GOVERSION }}-${{ hashFiles('go.mod', 'Makefile', '.golangci.yml', 'tools/lint-go-gopls.sh') }} - run: make deps-backend deps-tools - run: make lint-go-windows lint-go-vet @@ -140,7 +135,6 @@ jobs: ~/.cache/golangci-lint ~/.cache/gopls ${{ steps.vars.outputs.GOCACHE }} - ${{ steps.vars.outputs.GOMODCACHE }} key: golint-v1-${{ github.job }}-${{ runner.os }}-${{ runner.arch }}-${{ steps.vars.outputs.GOVERSION }}-${{ hashFiles('go.mod', 'Makefile', '.golangci.yml', 'tools/lint-go-gopls.sh') }} lint-go-gogit: @@ -156,7 +150,6 @@ jobs: - id: vars run: | echo "GOCACHE=$(go env GOCACHE)" >> "$GITHUB_OUTPUT" - echo "GOMODCACHE=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT" echo "GOVERSION=$(go env GOVERSION)" >> "$GITHUB_OUTPUT" - uses: actions/cache/restore@v4 with: @@ -164,7 +157,6 @@ jobs: ~/.cache/golangci-lint ~/.cache/gopls ${{ steps.vars.outputs.GOCACHE }} - ${{ steps.vars.outputs.GOMODCACHE }} key: golint-v1-${{ github.job }}-${{ runner.os }}-${{ runner.arch }}-${{ steps.vars.outputs.GOVERSION }}-${{ hashFiles('go.mod', 'Makefile', '.golangci.yml', 'tools/lint-go-gopls.sh') }} - run: make deps-backend deps-tools env: @@ -178,7 +170,6 @@ jobs: ~/.cache/golangci-lint ~/.cache/gopls ${{ steps.vars.outputs.GOCACHE }} - ${{ steps.vars.outputs.GOMODCACHE }} key: golint-v1-${{ github.job }}-${{ runner.os }}-${{ runner.arch }}-${{ steps.vars.outputs.GOVERSION }}-${{ hashFiles('go.mod', 'Makefile', '.golangci.yml', 'tools/lint-go-gopls.sh') }} checks-backend: From 7c66eb949063290456d88e7ae9b95c5b3fdf4901 Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 6 Jun 2024 01:54:31 +0200 Subject: [PATCH 13/15] cleanup --- .github/workflows/pull-compliance.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/pull-compliance.yml b/.github/workflows/pull-compliance.yml index 844f45a67154e..d5a9d50081b12 100644 --- a/.github/workflows/pull-compliance.yml +++ b/.github/workflows/pull-compliance.yml @@ -159,8 +159,6 @@ jobs: ${{ steps.vars.outputs.GOCACHE }} key: golint-v1-${{ github.job }}-${{ runner.os }}-${{ runner.arch }}-${{ steps.vars.outputs.GOVERSION }}-${{ hashFiles('go.mod', 'Makefile', '.golangci.yml', 'tools/lint-go-gopls.sh') }} - run: make deps-backend deps-tools - env: - GOOS: linux - run: make lint-go env: TAGS: bindata gogit sqlite sqlite_unlock_notify From 31207197372fdc9d82cda20df1d6bcdc7749c83f Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 6 Jun 2024 02:22:03 +0200 Subject: [PATCH 14/15] don't pre-install deps-tools in checks-backend --- .github/workflows/pull-compliance.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-compliance.yml b/.github/workflows/pull-compliance.yml index d5a9d50081b12..1a9cae695b393 100644 --- a/.github/workflows/pull-compliance.yml +++ b/.github/workflows/pull-compliance.yml @@ -180,7 +180,7 @@ jobs: with: go-version-file: go.mod check-latest: true - - run: make deps-backend deps-tools + - run: make deps-backend - run: make --always-make checks-backend # ensure the "go-licenses" make target runs frontend: From 35da678889becd3eb85b40f61c97dac1bd8be269 Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 6 Jun 2024 02:41:32 +0200 Subject: [PATCH 15/15] Revert "don't pre-install deps-tools in checks-backend" This reverts commit 31207197372fdc9d82cda20df1d6bcdc7749c83f. --- .github/workflows/pull-compliance.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-compliance.yml b/.github/workflows/pull-compliance.yml index 1a9cae695b393..d5a9d50081b12 100644 --- a/.github/workflows/pull-compliance.yml +++ b/.github/workflows/pull-compliance.yml @@ -180,7 +180,7 @@ jobs: with: go-version-file: go.mod check-latest: true - - run: make deps-backend + - run: make deps-backend deps-tools - run: make --always-make checks-backend # ensure the "go-licenses" make target runs frontend: