Files
Brad Fitzpatrick 1db8e79a8b .github: use gomodfs for the Go module cache on Windows CI
Instead of restoring the module cache from actions/cache, the Windows
jobs now install WinFsp and mount a gomodfs remote store (on the Azure
VNet, at vars.GOMODFS_AZURE_URL, defaulting to ci-gocached-azure-1:8090)
on M:, which also provides the tsgo toolchain via ~/.cache/tsgo. gomodfs
is started via ShellExecute so it doesn't inherit the step's pipes,
which would make the runner kill it at the end of the step, and a
separate step checks that it survived before pointing GOMODCACHE at it.
If anything fails, the jobs warn and fall back to downloading modules
and the toolchain directly.

Updates tailscale/corp#34812

Change-Id: I26cea9cfa483d5fb3fd51b1d0f87a9204f792690
Signed-off-by: Brad Fitzpatrick <[email protected]>
2026-11-21 11:12:52 -08:00

147 lines
5.2 KiB
YAML

# Runs tstest/integration on the Windows service three times a night, unattended mode on and off.
name: windows-nightly
on:
workflow_dispatch:
schedule:
# Three runs, 20 minutes apart and off the hour, to catch flaky tests.
- cron: "13,33,53 7 * * *"
pull_request:
paths:
- ".github/workflows/windows-nightly.yml"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
GOMODCACHE: ${{ github.workspace }}/gomodcache
CMD_GO_USE_GIT_HASH: "true"
permissions: {}
jobs:
nightly:
permissions:
id-token: write # request the identity JWT that authenticates to cigocached
contents: read # for actions/checkout
runs-on: ci-windows-github-1
name: Windows nightly (${{ matrix.suite }})
timeout-minutes: 45 # room for a 20m test run plus 10m of retries
strategy:
fail-fast: false
matrix:
include:
# One row per suite or mode, and each needs a line in notify's suites input.
- suite: integration
packages: ./tstest/integration
results_pkg: tailscale.com/tstest/integration
flags: --run-windows-service-tests
# -timeout=20m, so tests that fail slowly can't time out the package and drop the rest.
- suite: integration-unattended-off
packages: ./tstest/integration
results_pkg: tailscale.com/tstest/integration
flags: --run-windows-service-tests --windows-unattended=false -timeout=20m
steps:
- name: checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
path: ${{ github.workspace }}/src
persist-credentials: false
# This must run before anything uses ./tool/go, as it also provides the Go toolchain.
- name: Mount gomodfs
id: gomodfs
uses: ./src/.github/actions/gomodfs-mount
with:
store-url: ${{ vars.GOMODFS_AZURE_URL }}
- name: Set up cigocacher
uses: ./src/.github/actions/go-cache
with:
checkout-path: ${{ github.workspace }}/src
cache-dir: ${{ github.workspace }}/cigocacher
cigocached-url: ${{ vars.CIGOCACHED_AZURE_URL }}
cigocached-host: ${{ vars.CIGOCACHED_AZURE_HOST }}
- name: test
shell: bash
working-directory: src
# -count=1: a cached pass is never retried, so flakes can't be reported.
run: ./tool/go run ./cmd/testwrapper $PACKAGES -count=1 $FLAGS
env:
PACKAGES: ${{ matrix.packages }}
FLAGS: ${{ matrix.flags }}
NOPWSHDEBUG: "true" # to quiet tool/gocross/gocross-wrapper.ps1 in CI
TS_TESTWRAPPER_RESULTS_SUMMARY: "1"
TS_TESTWRAPPER_RESULTS_PKG: ${{ matrix.results_pkg }}
TS_TESTWRAPPER_RESULTS_JSON: ${{ github.workspace }}/windows-integration-results.json
- name: Upload results
if: always()
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: windows-nightly-${{ matrix.suite }}-results
path: ${{ github.workspace }}/windows-integration-results.json
if-no-files-found: ignore
retention-days: 90
- name: Check gomodfs is still running
if: always() && steps.gomodfs.outputs.success == 'true'
shell: pwsh
env:
LOG: ${{ steps.gomodfs.outputs.log }}
JOB_STATUS: ${{ job.status }}
run: ./src/.github/actions/gomodfs-mount/check.ps1
notify:
if: always()
needs:
- nightly
permissions:
contents: read # for actions/checkout
runs-on: ubuntu-24.04
steps:
- name: checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
path: ${{ github.workspace }}/src
persist-credentials: false
- name: Download results
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
# A pattern, not a name, so a run that never uploaded still gets reported.
pattern: windows-nightly-*-results
path: results
- name: Build Slack payload
id: payload
if: always()
uses: ./src/.github/actions/windows-slack-payload
with:
result: ${{ needs.nightly.result }}
title: Windows Nightly Tests
header: "*${{ github.ref_name }}*"
tests-label: smoke and integration tests
suites: |
windows-nightly-integration-results=(unattended on)
windows-nightly-integration-unattended-off-results=(unattended off)
# One result file per matrix row.
expected-files: "1"
- name: Print Slack payload
if: always()
# PR runs don't post, so this shows what a nightly run would send.
run: jq . payload.json
- name: Send Slack notification
env:
WEBHOOK: ${{ secrets.WINDOWS_SLACK_WEBHOOK_URL }}
# Posts on cancel too, so a missing message always means something went wrong.
if: always() && env.WEBHOOK != '' && github.event_name != 'pull_request'
continue-on-error: true
uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a # v2.1.1
with:
webhook: ${{ env.WEBHOOK }}
webhook-type: incoming-webhook
payload-file-path: payload.json