unarr/.github/workflows/ci.yml
Deivid Soto 29cf0a0126 feat: initial commit — unarr CLI
Search, inspect, stream, and download torrents from the terminal.
Replaces the entire *arr stack with a single binary.
2026-03-28 11:29:42 +01:00

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.22", "1.23", "1.24"]
steps:
- uses: actions/checkout@v4
- name: Checkout go-client (local replace dependency)
uses: actions/checkout@v4
with:
repository: torrentclaw/go-client
path: ../go-client
- name: Set up Go
uses: actions/setup-go@v5
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@v4
- name: Checkout go-client (local replace dependency)
uses: actions/checkout@v4
with:
repository: torrentclaw/go-client
path: ../go-client
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.24"
- 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@v4
- name: Checkout go-client (local replace dependency)
uses: actions/checkout@v4
with:
repository: torrentclaw/go-client
path: ../go-client
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.24"
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v2.1.6
coverage:
name: Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout go-client (local replace dependency)
uses: actions/checkout@v4
with:
repository: torrentclaw/go-client
path: ../go-client
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.24"
- name: Run tests with coverage
run: go test -race -coverprofile=coverage.out -covermode=atomic ./...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
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@v4
- name: Checkout go-client (local replace dependency)
uses: actions/checkout@v4
with:
repository: torrentclaw/go-client
path: ../go-client
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.24"
- name: Run go vet
run: go vet ./...