Skip to content

Commit 010b9d7

Browse files
authored
Disable Go CI caching (microsoft#2530)
1 parent dd30685 commit 010b9d7

4 files changed

Lines changed: 0 additions & 177 deletions

File tree

.github/actions/setup-go/action.yml

Lines changed: 0 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@ inputs:
55
go-version:
66
description: Go version to set up in go-install.ps1 format
77
default: 'go1.26'
8-
create:
9-
description: Create the cache
10-
default: 'false'
11-
lint-cache:
12-
description: Restore the golangci-lint cache
13-
default: 'false'
148

159
runs:
1610
using: composite
@@ -54,117 +48,3 @@ runs:
5448
GOBIN="$(go env GOPATH)/bin"
5549
fi
5650
echo "$GOBIN" >> $GITHUB_PATH
57-
58-
# Avoid hardcoding the cache keys more than once.
59-
- name: Get cache info
60-
shell: bash
61-
id: cache-info
62-
env:
63-
MODULES_KEY: go-modules-${{ runner.os }}-msft-${{ steps.install-go.outputs.go-version }}-${{ hashFiles('**/go.sum', '**/.custom-gcl.yml') }}
64-
LINT_KEY: golangci-lint-${{ runner.os }}-msft-${{ steps.install-go.outputs.go-version }}-${{ hashFiles('**/go.sum', '**/.custom-gcl.yml') }}
65-
BUILD_KEY: go-build-cache-${{ runner.os }}-msft-${{ steps.install-go.outputs.go-version }}
66-
run: |
67-
echo "modules-key=$MODULES_KEY" >> $GITHUB_OUTPUT
68-
echo "lint-key=$LINT_KEY" >> $GITHUB_OUTPUT
69-
echo "build-key=$BUILD_KEY" >> $GITHUB_OUTPUT
70-
echo "GOLANGCI_LINT_CACHE=$RUNNER_TEMP/golangci-lint-cache" >> $GITHUB_ENV
71-
72-
- if: ${{ inputs.create != 'true' }}
73-
name: Restore Go modules
74-
uses: actions/cache/restore@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
75-
with:
76-
key: ${{ steps.cache-info.outputs.modules-key }}
77-
path: |
78-
~/go/pkg/mod
79-
80-
- if: ${{ inputs.create != 'true' }}
81-
name: Restore Go build cache
82-
uses: actions/cache/restore@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
83-
with:
84-
key: unused-key-${{ github.run_id }}
85-
restore-keys: ${{ steps.cache-info.outputs.build-key }}-
86-
path: |
87-
~/.cache/go-build
88-
~/Library/Caches/go-build
89-
~/AppData/Local/go-build
90-
91-
- if: ${{ inputs.create != 'true' && inputs.lint-cache == 'true' }}
92-
name: Restore golangci-lint cache
93-
uses: actions/cache/restore@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
94-
with:
95-
key: unused-key-${{ github.run_id }}
96-
restore-keys: ${{ steps.cache-info.outputs.lint-key }}-
97-
path: ${{ env.GOLANGCI_LINT_CACHE }}
98-
99-
- name: Set mtimes
100-
shell: bash
101-
run: |
102-
find . -type f ! -path ./.git/\*\* | go run github.com/slsyy/mtimehash/cmd/mtimehash@v1.0.0 || true
103-
find . -type d ! -path ./.git/\*\* -exec touch -d '1970-01-01T00:00:01Z' {} + || true
104-
105-
# All steps below are only run if the cache is being created.
106-
107-
- if: ${{ inputs.create == 'true' }}
108-
shell: bash
109-
run: npm ci
110-
111-
- if: ${{ inputs.create == 'true' }}
112-
shell: bash
113-
run: |
114-
go mod download
115-
cd _tools
116-
go mod download
117-
118-
- if: ${{ inputs.create == 'true' }}
119-
shell: bash
120-
run: npx hereby build
121-
122-
- if: ${{ inputs.create == 'true' }}
123-
shell: bash
124-
id: setup-go-test
125-
run: npx hereby test
126-
127-
- if: ${{ failure() && inputs.create == 'true' && steps.setup-go-test.conclusion == 'failure' }}
128-
shell: bash
129-
run: git diff --diff-filter=AM --no-index ./testdata/baselines/reference ./testdata/baselines/local
130-
131-
- if: ${{ inputs.create == 'true' }}
132-
shell: bash
133-
run: npx hereby test --coverage
134-
135-
- if: ${{ inputs.create == 'true' }}
136-
shell: bash
137-
run: npx hereby lint
138-
139-
- if: ${{ inputs.create == 'true' }}
140-
shell: bash
141-
run: npx hereby lint --noembed
142-
143-
- if: ${{ inputs.create == 'true' }}
144-
shell: bash
145-
run: npx dprint check
146-
147-
- if: ${{ inputs.create == 'true' }}
148-
name: Save Go modules
149-
uses: actions/cache/save@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
150-
with:
151-
key: ${{ steps.cache-info.outputs.modules-key }}
152-
path: |
153-
~/go/pkg/mod
154-
155-
- if: ${{ inputs.create == 'true' }}
156-
name: Save Go build cache
157-
uses: actions/cache/save@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
158-
with:
159-
key: ${{ steps.cache-info.outputs.build-key }}-${{ github.run_id }}
160-
path: |
161-
~/.cache/go-build
162-
~/Library/Caches/go-build
163-
~/AppData/Local/go-build
164-
165-
- if: ${{ inputs.create == 'true' }}
166-
name: Save golangci-lint cache
167-
uses: actions/cache/save@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
168-
with:
169-
key: ${{ steps.cache-info.outputs.lint-key }}-${{ github.run_id }}
170-
path: ${{ env.GOLANGCI_LINT_CACHE }}

.github/workflows/ci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,6 @@ jobs:
234234
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
235235
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
236236
- uses: ./.github/actions/setup-go
237-
with:
238-
lint-cache: 'true'
239237

240238
# Avoid duplicate PR annotations.
241239
- if: ${{ ! matrix.config.main }}

.github/workflows/copilot-setup-steps.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ jobs:
2929
with:
3030
node-version: '>=22.16.0'
3131
- uses: ./.github/actions/setup-go
32-
with:
33-
lint-cache: 'true'
3432
- run: npm i -g @playwright/mcp@0.0.28
3533
- run: go install golang.org/x/tools/gopls@latest
3634
- run: npm ci

.github/workflows/create-cache.yml

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)