reduce number of changes to see perf

Change-Id: I7644590e05a294e28f0acc9194a950a503822929
Signed-off-by: Tom Proctor <tomhjp@users.noreply.github.com>
tomhjp/cigocacher-windows
Tom Proctor 2 weeks ago
parent a008d97105
commit e8132c51c1
No known key found for this signature in database

@ -8,6 +8,9 @@ inputs:
checkout-path: checkout-path:
description: Path to cloned repository description: Path to cloned repository
required: true required: true
cache-dir:
description: Directory to use for caching
required: true
outputs: outputs:
success: success:

@ -213,7 +213,7 @@ jobs:
# org with 8 cores and 32 GB of RAM: # org with 8 cores and 32 GB of RAM:
# https://github.com/organizations/tailscale/settings/actions/github-hosted-runners/1 # https://github.com/organizations/tailscale/settings/actions/github-hosted-runners/1
runs-on: ci-windows-github-1 runs-on: ci-windows-github-1
# needs: gomod-cache needs: gomod-cache
name: Windows (${{ matrix.name || matrix.shard}}) name: Windows (${{ matrix.name || matrix.shard}})
strategy: strategy:
fail-fast: false # don't abort the entire matrix if one element fails fail-fast: false # don't abort the entire matrix if one element fails
@ -230,55 +230,45 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with: with:
path: src path: src
# - name: Restore Go module cache
# uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
# with:
# path:
- uses: samypr100/setup-dev-drive@30f0f98ae5636b2b6501e181dfb3631b9974818d # v4.0.0
with:
drive-size: 50GB # 300GB available: https://docs.github.com/en/enterprise-cloud@latest/actions/reference/runners/larger-runners#machine-sizes-for-larger-runners
trusted-dev-drive: true
workspace-copy: true
- name: Install Go - name: Install Go
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with: with:
go-version-file: ${{ env.DEV_DRIVE_WORKSPACE }}/src/go.mod go-version-file: src/go.mod
cache: false cache: false
# - name: Restore Go module cache - name: Restore Go module cache
# uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
# with: with:
# path: gomodcache path: gomodcache
# key: ${{ needs.gomod-cache.outputs.cache-key }} key: ${{ needs.gomod-cache.outputs.cache-key }}
# enableCrossOsArchive: true enableCrossOsArchive: true
- name: Setup cigocacher - name: Setup cigocacher
id: cigocacher-setup id: cigocacher-setup
uses: ./src/.github/actions/go-cache uses: ./src/.github/actions/go-cache
with: with:
checkout-path: ${{ env.DEV_DRIVE_WORKSPACE }}/src checkout-path: src
cache-dir: ${{ env.DEV_DRIVE_WORKSPACE }}/cigocacher cache-dir: cigocacher
cigocached-url: ${{ vars.CIGOCACHED_AZURE_URL }} cigocached-url: ${{ vars.CIGOCACHED_AZURE_URL }}
- name: test - name: test
if: matrix.key != 'win-bench' # skip on bench builder if: matrix.key != 'win-bench' # skip on bench builder
working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}/src working-directory: src
run: go run ./cmd/testwrapper sharded:${{ matrix.shard }} run: go run ./cmd/testwrapper sharded:${{ matrix.shard }}
- name: bench all - name: bench all
if: matrix.key == 'win-bench' if: matrix.key == 'win-bench'
working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}/src working-directory: src
# Don't use -bench=. -benchtime=1x. # Don't use -bench=. -benchtime=1x.
# Somewhere in the layers (powershell?) # Somewhere in the layers (powershell?)
# the equals signs cause great confusion. # the equals signs cause great confusion.
run: go test ./... -bench . -benchtime 1x -run "^$" run: go test ./... -bench . -benchtime 1x -run "^$"
- name: Tidy cache - name: Tidy cache
working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}/src
shell: pwsh shell: pwsh
run: | run: |
Get-ChildItem -Path "${{ env.DEV_DRIVE_WORKSPACE }}\cigocacher" -File -Recurse | Get-ChildItem -Path cigocacher -File -Recurse |
Where-Object { $_.LastAccessTime -lt (Get-Date).AddMinutes(-90) } | Where-Object { $_.LastAccessTime -lt (Get-Date).AddMinutes(-90) } |
Remove-Item -Force Remove-Item -Force

@ -75,7 +75,9 @@ func main() {
verbose: *verbose, verbose: *verbose,
} }
if *cigocachedURL != "" { if *cigocachedURL != "" {
if *verbose {
log.Printf("Using cigocached at %s", *cigocachedURL) log.Printf("Using cigocached at %s", *cigocachedURL)
}
c.gocached = &gocachedClient{ c.gocached = &gocachedClient{
baseURL: *cigocachedURL, baseURL: *cigocachedURL,
cl: httpClient(), cl: httpClient(),

@ -151,4 +151,4 @@
}); });
}; };
} }
# nix-direnv cache busting line: sha256-IkodqRYdueML7U2Hh8vRw6Et7+WII+VXuPJ3jZ2xYx8= # nix-direnv cache busting line: sha256-4AFRl1Dd6S2HusZFtK+kCqD3RGTmLytQ5EhYYvlZrL4=

@ -1 +1 @@
sha256-IkodqRYdueML7U2Hh8vRw6Et7+WII+VXuPJ3jZ2xYx8= sha256-4AFRl1Dd6S2HusZFtK+kCqD3RGTmLytQ5EhYYvlZrL4=

@ -16,4 +16,4 @@
) { ) {
src = ./.; src = ./.;
}).shellNix }).shellNix
# nix-direnv cache busting line: sha256-IkodqRYdueML7U2Hh8vRw6Et7+WII+VXuPJ3jZ2xYx8= # nix-direnv cache busting line: sha256-4AFRl1Dd6S2HusZFtK+kCqD3RGTmLytQ5EhYYvlZrL4=

Loading…
Cancel
Save