Skip to content

Simplify CLI: Make --root and --config optional #14

Simplify CLI: Make --root and --config optional

Simplify CLI: Make --root and --config optional #14

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
- name: Cache Go modules
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download dependencies
run: go mod download
- name: Verify dependencies
run: go mod verify
- name: Run vet
run: go vet ./...
- name: Run tests
run: go test -race -cover ./...
- name: Build
run: go build -o navigator ./cmd/navigator
- name: Test binary
run: |
# Create minimal test environment
mkdir -p /tmp/test-rails/config/tenant
echo '"2025": {}' > /tmp/test-rails/config/tenant/showcases.yml
# Test that binary starts and exits cleanly with new CLI syntax
timeout 5s ./navigator serve --root /tmp/test-rails --listen :0 || [ $? -eq 124 ]
build:
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
- name: Build binaries
run: |
# Linux AMD64
GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" -o navigator-linux-amd64 ./cmd/navigator
# Linux ARM64
GOOS=linux GOARCH=arm64 go build -ldflags "-s -w" -o navigator-linux-arm64 ./cmd/navigator
# macOS AMD64
GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w" -o navigator-darwin-amd64 ./cmd/navigator
# macOS ARM64
GOOS=darwin GOARCH=arm64 go build -ldflags "-s -w" -o navigator-darwin-arm64 ./cmd/navigator
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: navigator-binaries
path: navigator-*