Skip to content
This repository was archived by the owner on Apr 15, 2026. It is now read-only.

refactor(cli): separate instance creation from session management #112

refactor(cli): separate instance creation from session management

refactor(cli): separate instance creation from session management #112

Workflow file for this run

name: CLI
on:
pull_request:
paths:
- '**.go'
- 'go.mod'
- 'go.sum'
- '.golangci.yml'
- '.github/workflows/cli.yml'
push:
branches:
- master
paths:
- '**.go'
- 'go.mod'
- 'go.sum'
- '.golangci.yml'
- '.github/workflows/cli.yml'
jobs:
check:
name: Check
runs-on: warp-ubuntu-latest-x64-4x
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Set up Go
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5
with:
go-version-file: go.mod
cache: true
- name: Check formatting
run: |
# Check if gofmt would make changes
if [ -n "$(gofmt -l .)" ]; then
echo "::error::Code is not formatted. Run 'gofmt -w .' to fix."
gofmt -d .
exit 1
fi
- name: Check import formatting
run: |
go install golang.org/x/tools/cmd/goimports@latest
# Check if goimports would make changes
if [ -n "$(goimports -l -local github.com/jmgilman/headjack .)" ]; then
echo "::error::Imports are not formatted. Run 'goimports -w -local github.com/jmgilman/headjack .' to fix."
goimports -d -local github.com/jmgilman/headjack .
exit 1
fi
- name: Run linter
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8
with:
version: latest
- name: Run tests
run: go test -race -coverprofile=coverage.out ./...
- name: Upload coverage report
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: coverage-report
path: coverage.out
retention-days: 7