You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailscale/.github/workflows/win.yml

93 lines
3.0 KiB
YAML

name: win-ci
on:
push:
jobs:
windows:
runs-on: windows-latest
name: Windows (${{ matrix.name || matrix.shard}})
strategy:
fail-fast: false # don't abort the entire matrix if one element fails
matrix:
include:
- key: "win-bench"
name: "benchmarks"
- key: "win-shard-1-2"
shard: "1/2"
- key: "win-shard-2-2"
shard: "2/2"
steps:
- name: checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
path: src
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
key: ${{ matrix.key }}-dev-drive-${{ hashFiles('src/go.mod', 'src/go.sum') }}
path: C:\\dev_disk.vhdx
- uses: samypr100/setup-dev-drive@30f0f98ae5636b2b6501e181dfb3631b9974818d # v4.0.0
with:
drive-size: 10GB # 300GB available: https://docs.github.com/en/enterprise-cloud@latest/actions/reference/runners/larger-runners#machine-sizes-for-larger-runners
workspace-copy: true
drive-path: C:\\dev_disk.vhdx
mount-if-exists: true
- name: Check restored cache
shell: pwsh
run: |
if (Test-Path "${{ env.DEV_DRIVE }}/gocache") {
Get-ChildItem -Recurse ${{ env.DEV_DRIVE }}/gocache
} else {
Write-Host "gocache directory does not exist yet"
}
if (Test-Path "${{ env.DEV_DRIVE }}/gomodcache") {
Get-ChildItem -Recurse ${{ env.DEV_DRIVE }}/gomodcache
} else {
Write-Host "gomodcache directory does not exist yet"
}
- name: Install Go
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version-file: ${{ env.DEV_DRIVE_WORKSPACE }}/src/go.mod
cache: false
- name: test
if: matrix.key != 'win-bench' # skip on bench builder
working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}/src
env:
GOCACHE: ${{ env.DEV_DRIVE }}/gocache
GOMODCACHE: ${{ env.DEV_DRIVE }}/gomodcache
run: go run ./cmd/testwrapper sharded:${{ matrix.shard }}
- name: bench all
if: matrix.key == 'win-bench'
working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}/src
env:
GOCACHE: ${{ env.DEV_DRIVE }}/gocache
GOMODCACHE: ${{ env.DEV_DRIVE }}/gomodcache
# Don't use -bench=. -benchtime=1x.
# Somewhere in the layers (powershell?)
# the equals signs cause great confusion.
run: go test ./... -bench . -benchtime 1x -run "^$"
- name: Tidy cache
shell: pwsh
run: |
Get-ChildItem -Path "${{ env.DEV_DRIVE }}/gocache" -File -Recurse |
Where-Object { $_.LastAccessTime -lt (Get-Date).AddMinutes(-90) } |
Remove-Item -Force
win-tool-go:
runs-on: windows-latest
name: Windows (win-tool-go)
steps:
- name: checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
path: src
- name: test-tool-go
working-directory: src
run: ./tool/go version