Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:

permissions:
contents: read

jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ "1.21.x", "1.22.x", "1.23.x", "1.24.x", "1.25.x", "1.26.x"]

steps:
- uses: actions/checkout@v4

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}

- name: Verify dependencies
run: go mod verify

- name: Build
run: go build -v ./...

- name: Run tests with race detector
run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...

lint:
name: Lint Code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.21.x"
cache: false # golangci-lint-action handles its own caching

- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
args: --timeout=5m
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func main() {

// 2. Worker reuse is disabled to prevent state leaks between sessions
pool, _ := herd.New(factory,
herd.WithAutoScale(1, 5),
herd.WithAutoScale(1, 5), // auto-scale between 1 and 5 concurrent tenants (until expires)
herd.WithTTL(15 * time.Minute),
herd.WithWorkerReuse(false), // CRITICAL: Never share browsers between users
)
Expand Down
1 change: 0 additions & 1 deletion pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ type Pool[C any] struct {
workers []Worker[C] // all known workers (for Stats / Shutdown)
available chan Worker[C] // free workers

wg sync.WaitGroup
done chan struct{} // closed when the pool is shutting down, all the background loops will listen for this

// pool context for canceling all the background loops
Expand Down
Loading