- Go deps: cobra 1.10.2, fatih/color 1.19, tablewriter 1.1.4, anacrolix/torrent 1.61, charmbracelet/huh 1.0, pion/webrtc 4.2.11 - GitHub Actions: checkout v6, setup-go v6, golangci-lint-action v9, codecov-action v5, ghaction-upx v4, goreleaser-action v7 - CI matrix: drop Go 1.22, test on 1.24 + 1.25 - Migrate tablewriter API from v0 to v1 (breaking change) - Fix data race in WSTransport.readLoop (pass conn as parameter) - Add file.Sync() before close in debrid and usenet downloaders - Improve progress tracker: dedup MarkDone, re-mark dirty on flush error
131 lines
2.9 KiB
YAML
131 lines
2.9 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
test:
|
|
name: Test
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
go-version: ["1.25", "1.26"]
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: Checkout go-client (local replace dependency)
|
|
uses: actions/checkout@v6
|
|
with:
|
|
repository: torrentclaw/go-client
|
|
path: ../go-client
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v6
|
|
with:
|
|
go-version: ${{ matrix.go-version }}
|
|
|
|
- name: Run tests
|
|
run: go test -v -race -count=1 ./...
|
|
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
goos: [linux, darwin, windows]
|
|
goarch: [amd64, arm64]
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: Checkout go-client (local replace dependency)
|
|
uses: actions/checkout@v6
|
|
with:
|
|
repository: torrentclaw/go-client
|
|
path: ../go-client
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v6
|
|
with:
|
|
go-version: "1.25"
|
|
|
|
- name: Build
|
|
env:
|
|
GOOS: ${{ matrix.goos }}
|
|
GOARCH: ${{ matrix.goarch }}
|
|
run: go build -o unarr ./cmd/unarr/
|
|
|
|
lint:
|
|
name: Lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: Checkout go-client (local replace dependency)
|
|
uses: actions/checkout@v6
|
|
with:
|
|
repository: torrentclaw/go-client
|
|
path: ../go-client
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v6
|
|
with:
|
|
go-version: "1.25"
|
|
|
|
- name: Run golangci-lint
|
|
uses: golangci/golangci-lint-action@v9
|
|
with:
|
|
version: latest
|
|
|
|
coverage:
|
|
name: Coverage
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: Checkout go-client (local replace dependency)
|
|
uses: actions/checkout@v6
|
|
with:
|
|
repository: torrentclaw/go-client
|
|
path: ../go-client
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v6
|
|
with:
|
|
go-version: "1.25"
|
|
|
|
- name: Run tests with coverage
|
|
run: go test -race -coverprofile=coverage.out -covermode=atomic ./...
|
|
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v5
|
|
with:
|
|
file: ./coverage.out
|
|
fail_ci_if_error: false
|
|
env:
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
vet:
|
|
name: Vet
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: Checkout go-client (local replace dependency)
|
|
uses: actions/checkout@v6
|
|
with:
|
|
repository: torrentclaw/go-client
|
|
path: ../go-client
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v6
|
|
with:
|
|
go-version: "1.25"
|
|
|
|
- name: Run go vet
|
|
run: go vet ./...
|