Skip to content

feat: auto-prune stale unpaired devices #69

feat: auto-prune stale unpaired devices

feat: auto-prune stale unpaired devices #69

Workflow file for this run

name: CI
on:
push:
branches: [main, master]
paths-ignore:
- "**.md"
- ".goreleaser.yaml"
- "packaging/**"
- "desktop-integration/**"
pull_request:
branches: [main, master]
paths-ignore:
- "**.md"
- ".goreleaser.yaml"
- "packaging/**"
- "desktop-integration/**"
permissions:
contents: read
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Verify dependencies
run: go mod verify
- name: Run tests
# Race detector (-race) requires cgo enabled. Only enable CGO for the test step.
run: CGO_ENABLED=1 go test -p 1 -race -count=1 ./...
build:
name: Build (${{ matrix.goos }}/${{ matrix.goarch }})
runs-on: ubuntu-latest
needs: test
strategy:
fail-fast: false
matrix:
include:
- goos: linux
goarch: amd64
- goos: linux
goarch: arm64
- goos: linux
goarch: arm
goarm: "7"
- goos: darwin
goarch: amd64
- goos: darwin
goarch: arm64
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Build
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
GOARM: ${{ matrix.goarm }}
CGO_ENABLED: "0"
run: |
go build -trimpath -ldflags="-s -w" -o /dev/null ./cmd/kcd
goreleaser-check:
name: GoReleaser config check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Check GoReleaser config
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: "~> v2"
args: check
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- uses: golangci/golangci-lint-action@v9
with:
version: v2.11
integration-test:
name: Integration Tests
runs-on: ubuntu-latest
if: github.event_name == 'push'
needs: test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Run integration tests
run: CGO_ENABLED=1 go test -tags integration -race -count=1 ./internal/integration/...