Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 0 additions & 114 deletions .github/actions/setup-go/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ inputs:
go-version:
description: Go version to set up in go-install.ps1 format
default: 'go1.25'
create:
description: Create the cache
default: 'false'
lint-cache:
description: Restore the golangci-lint cache
default: 'false'

runs:
using: composite
Expand Down Expand Up @@ -55,116 +49,8 @@ runs:
fi
echo "$GOBIN" >> $GITHUB_PATH

# Avoid hardcoding the cache keys more than once.
- name: Get cache info
shell: bash
id: cache-info
env:
MODULES_KEY: go-modules-${{ runner.os }}-msft-${{ steps.install-go.outputs.go-version }}-${{ hashFiles('**/go.sum', '**/.custom-gcl.yml') }}
LINT_KEY: golangci-lint-${{ runner.os }}-msft-${{ steps.install-go.outputs.go-version }}-${{ hashFiles('**/go.sum', '**/.custom-gcl.yml') }}
BUILD_KEY: go-build-cache-${{ runner.os }}-msft-${{ steps.install-go.outputs.go-version }}
run: |
echo "modules-key=$MODULES_KEY" >> $GITHUB_OUTPUT
echo "lint-key=$LINT_KEY" >> $GITHUB_OUTPUT
echo "build-key=$BUILD_KEY" >> $GITHUB_OUTPUT
echo "GOLANGCI_LINT_CACHE=$RUNNER_TEMP/golangci-lint-cache" >> $GITHUB_ENV

- if: ${{ inputs.create != 'true' }}
name: Restore Go modules
uses: actions/cache/restore@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
key: ${{ steps.cache-info.outputs.modules-key }}
path: |
~/go/pkg/mod

- if: ${{ inputs.create != 'true' }}
name: Restore Go build cache
uses: actions/cache/restore@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
key: unused-key-${{ github.run_id }}
restore-keys: ${{ steps.cache-info.outputs.build-key }}-
path: |
~/.cache/go-build
~/Library/Caches/go-build
~/AppData/Local/go-build

- if: ${{ inputs.create != 'true' && inputs.lint-cache == 'true' }}
name: Restore golangci-lint cache
uses: actions/cache/restore@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
key: unused-key-${{ github.run_id }}
restore-keys: ${{ steps.cache-info.outputs.lint-key }}-
path: ${{ env.GOLANGCI_LINT_CACHE }}

- name: Set mtimes
shell: bash
run: |
find . -type f ! -path ./.git/\*\* | go run github.com/slsyy/mtimehash/cmd/[email protected] || true
find . -type d ! -path ./.git/\*\* -exec touch -d '1970-01-01T00:00:01Z' {} + || true

# All steps below are only run if the cache is being created.

- if: ${{ inputs.create == 'true' }}
shell: bash
run: npm ci

- if: ${{ inputs.create == 'true' }}
shell: bash
run: |
go mod download
cd _tools
go mod download

- if: ${{ inputs.create == 'true' }}
shell: bash
run: npx hereby build

- if: ${{ inputs.create == 'true' }}
shell: bash
id: setup-go-test
run: npx hereby test

- if: ${{ failure() && inputs.create == 'true' && steps.setup-go-test.conclusion == 'failure' }}
shell: bash
run: git diff --diff-filter=AM --no-index ./testdata/baselines/reference ./testdata/baselines/local

- if: ${{ inputs.create == 'true' }}
shell: bash
run: npx hereby test --coverage

- if: ${{ inputs.create == 'true' }}
shell: bash
run: npx hereby lint

- if: ${{ inputs.create == 'true' }}
shell: bash
run: npx hereby lint --noembed

- if: ${{ inputs.create == 'true' }}
shell: bash
run: npx dprint check

- if: ${{ inputs.create == 'true' }}
name: Save Go modules
uses: actions/cache/save@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
key: ${{ steps.cache-info.outputs.modules-key }}
path: |
~/go/pkg/mod

- if: ${{ inputs.create == 'true' }}
name: Save Go build cache
uses: actions/cache/save@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
key: ${{ steps.cache-info.outputs.build-key }}-${{ github.run_id }}
path: |
~/.cache/go-build
~/Library/Caches/go-build
~/AppData/Local/go-build

- if: ${{ inputs.create == 'true' }}
name: Save golangci-lint cache
uses: actions/cache/save@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
key: ${{ steps.cache-info.outputs.lint-key }}-${{ github.run_id }}
path: ${{ env.GOLANGCI_LINT_CACHE }}
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,6 @@ jobs:
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
- uses: ./.github/actions/setup-go
with:
lint-cache: 'true'

# Avoid duplicate PR annotations.
- if: ${{ ! matrix.config.main }}
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ jobs:
node-version: '>=22.16.0'
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
- uses: ./.github/actions/setup-go
with:
lint-cache: 'true'
- run: npm i -g @playwright/[email protected]
- run: go install golang.org/x/tools/gopls@latest
- run: npm ci
Expand Down
54 changes: 0 additions & 54 deletions .github/workflows/create-cache.yml

This file was deleted.