mirror of
https://github.com/pgsty/silo.git
synced 2026-10-26 21:57:00 +00:00
a2073d2514
Reuse deleteObjectReconciled for tiered bulk entries and unversioned single deletes. Its reference-aware cleanup avoids scheduling remote contents for garbage collection while another copy still needs them, including restored copies. Keep the normal local-data bulk path unchanged. Extend existing tier GC regressions to bulk and unversioned deletes and include them in the multi-pool race CI step. Signed-off-by: Feng Ruohang <rh@vonng.com>
185 lines
5.8 KiB
YAML
185 lines
5.8 KiB
YAML
name: Go CI
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
push:
|
|
branches:
|
|
- main
|
|
workflow_dispatch:
|
|
|
|
# Cancel superseded runs for the same PR; never cancel main push runs.
|
|
# Keyed on PR number (not head_ref) so fork PRs sharing a branch name
|
|
# do not collide.
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
|
|
cancel-in-progress: true
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
verify:
|
|
name: Format, Build, Vet
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 20
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
|
|
- uses: actions/setup-go@v7
|
|
with:
|
|
go-version-file: go.mod
|
|
cache: true
|
|
|
|
- name: Check gofmt
|
|
run: |
|
|
mapfile -t unformatted < <(gofmt -l main.go cmd internal \
|
|
buildscripts/rebrand-guard buildscripts/helm-migration-guard)
|
|
if [ "${#unformatted[@]}" -ne 0 ]; then
|
|
echo "The following files are not gofmt-formatted:"
|
|
printf '%s\n' "${unformatted[@]}"
|
|
gofmt -d "${unformatted[@]}"
|
|
exit 1
|
|
fi
|
|
|
|
- name: Build
|
|
env:
|
|
CGO_ENABLED: 0
|
|
run: go build ./...
|
|
|
|
- name: Vet
|
|
run: go vet ./...
|
|
|
|
- name: Verify rebrand compatibility contracts
|
|
run: |
|
|
go run ./buildscripts/rebrand-guard
|
|
buildscripts/verify-rebrand.sh
|
|
dockerscripts/docker-entrypoint_test.sh
|
|
|
|
quality:
|
|
name: Lint, Generated Files
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 25
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
|
|
- uses: actions/setup-go@v7
|
|
with:
|
|
go-version-file: go.mod
|
|
cache: true
|
|
|
|
- name: Lint
|
|
run: make lint
|
|
|
|
- name: Check generated files
|
|
run: make check-gen
|
|
|
|
race-s3select:
|
|
name: Race, S3 Select
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
|
|
- uses: actions/setup-go@v7
|
|
with:
|
|
go-version-file: go.mod
|
|
cache: true
|
|
|
|
- name: Run S3 Select tests under race detector
|
|
run: go test -race ./internal/s3select/... -count=1
|
|
|
|
- name: Run conditional PUT tests under race detector
|
|
run: go test -race ./cmd -run '^Test(PoolsConditionalPut|SinglePoolConditionalPutHTTP)' -count=1 -timeout=5m
|
|
|
|
- name: Run multi-pool delete consistency tests under race detector
|
|
run: go test -race ./cmd -run '^Test(Pools(Delete|BulkDelete|RetiringCopyPreservesSharedTierObject)|BulkDeleteQuorumEvidence)' -count=1 -timeout=5m
|
|
|
|
- name: Run multipart listing, cancellation and cleanup tests under race detector
|
|
env:
|
|
MINIO_API_REQUESTS_MAX: "10000"
|
|
run: go test -race ./cmd -run '^Test(Multipart|PaginateMultipartUploads|ListMultipartUploads|CleanupStaleUploads|ExtractModTime)' -count=1 -timeout=5m
|
|
|
|
- name: Run listing metadata recovery, pagination and cancellation tests under race detector
|
|
run: go test -race ./cmd -run '^Test(ListFallback|ListingCache|ListingMerge|ListingRecovery|ListingPending|ListingEntry|ListingSecondLock|StreamMetadataParts|LocalLockerListing|DistributedListing|MergeXLV2LatestNullCrossParity|CountXLV2MixedECGroups|ListCrossParity)' -count=1 -timeout=5m
|
|
|
|
- name: Run lock cancellation and late-grant cleanup tests under race detector
|
|
run: go test -race ./internal/dsync ./internal/lsync -run '^Test(DRWMutex|LRWMutex)' -count=1 -timeout=5m
|
|
|
|
- name: Run CPU metrics tests under race detector
|
|
run: go test -race ./cmd -run '^TestLoadCPUMetrics' -count=1 -timeout=5m
|
|
|
|
- name: Run tag replication tests under race detector
|
|
run: go test -race ./cmd -run '^TestAPITagging' -count=1 -timeout=5m
|
|
|
|
- name: Run Object Lock authorization and overwrite tests under race detector
|
|
env:
|
|
MINIO_API_REQUESTS_MAX: "10000"
|
|
run: go test -race -tags kqueue,dev ./cmd -run '^Test(APIPutObjectRetention|APIVersionAddressedWrite|PutObjectRetention|DirectoryObjectLock|ObjectLockOverwrite|APICopyObjectPreservesVersionAfterSuspension|MultipartNullObjectLock|PoolsObjectLockOverwrite|MultipartVersioningTransitions|PlanReview|RecoveredMultipartUpload)' -count=1 -timeout=5m
|
|
|
|
crosscompile:
|
|
name: Cross Compile
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 20
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
|
|
- uses: actions/setup-go@v7
|
|
with:
|
|
go-version-file: go.mod
|
|
cache: true
|
|
|
|
- name: Build supported targets
|
|
run: make crosscompile
|
|
|
|
test-internal:
|
|
name: Test internal/
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 25
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
|
|
- uses: actions/setup-go@v7
|
|
with:
|
|
go-version-file: go.mod
|
|
cache: true
|
|
|
|
# internal/http listener tests bind [::1]; runners disable IPv6 by default.
|
|
- name: Enable IPv6
|
|
run: |
|
|
sudo sysctl net.ipv6.conf.all.disable_ipv6=0
|
|
sudo sysctl net.ipv6.conf.default.disable_ipv6=0
|
|
|
|
- name: Run internal tests
|
|
env:
|
|
CGO_ENABLED: 0
|
|
MINIO_API_REQUESTS_MAX: "10000"
|
|
run: go test ./internal/... -count=1
|
|
|
|
test-cmd:
|
|
name: Test cmd/
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 35
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
|
|
- uses: actions/setup-go@v7
|
|
with:
|
|
go-version-file: go.mod
|
|
cache: true
|
|
|
|
# Some server tests bind IPv6 listeners; runners disable IPv6 by default.
|
|
- name: Enable IPv6
|
|
run: |
|
|
sudo sysctl net.ipv6.conf.all.disable_ipv6=0
|
|
sudo sysctl net.ipv6.conf.default.disable_ipv6=0
|
|
|
|
- name: Run cmd tests
|
|
env:
|
|
CGO_ENABLED: 0
|
|
MINIO_API_REQUESTS_MAX: "10000"
|
|
# cmd/ is one large package; raise go test's default 10m per-package
|
|
# timeout so slower runners fail on the job timeout, not a panic.
|
|
run: go test ./cmd/ -count=1 -timeout 30m
|