Files
seaweedfs/seaweed-block/.github/workflows/test.yml
T
2026-11-18 08:07:17 -08:00

60 lines
2.0 KiB
YAML

name: Test
on:
pull_request:
push:
branches:
- main
permissions:
contents: read
# One run per PR (or per branch for pushes). A new push to a PR cancels the
# superseded run; runs on main are never cancelled so every merge gets a result.
concurrency:
group: test-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
test:
name: go test (linux)
# Pushes and same-repo PRs run on the team's tp04 runner (seaweed.slice,
# capped at 8 cores / 8 GiB). Fork PRs never reach it: they stay on a
# GitHub-hosted runner.
runs-on: ${{ (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && 'tp04-seaweed-block' || 'ubuntu-latest' }}
timeout-minutes: 25
env:
# Pure-Go build: no package in the default build needs cgo, and the
# hosted runner should not depend on a C toolchain being present.
CGO_ENABLED: "0"
steps:
- name: Checkout
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
persist-credentials: false
- name: Set up Go
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version-file: go.mod
cache: true
cache-dependency-path: go.sum
- name: Go version
run: go version
- name: Build
run: go build ./...
- name: Vet
run: go vet ./...
- name: Test default configuration
run: go test -p=1 -short -count=1 -timeout 10m ./...
- name: Test legacy-fixture configuration
# Legacy-input fixtures and native caller controls stay executable after
# their constructors move behind the explicit test-only build tag.
# Bound package concurrency for existing short wall-clock assertions.
run: go test -p=1 -short -tags=swblock_format_v3_test -count=1 -timeout 10m ./...