Skip to content

preview-release

preview-release #402

Workflow file for this run

name: CLI
on:
push:
branches: [ main, next ]
paths:
- 'cli/**'
- 'docs/**'
- 'examples/**'
- '.github/workflows/cli.yml'
pull_request:
branches: [ main, next ]
paths:
- 'cli/**'
- 'docs/**'
- 'examples/**'
- '.github/workflows/cli.yml'
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'
cache-dependency-path: cli/go.sum
- name: Sync topic docs
run: make sync-docs
- name: Install linters
run: make lint-install
- name: Run lint
run: make lint
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'
cache-dependency-path: cli/go.sum
- name: Sync topic docs
run: make sync-docs
- name: Download dependencies
run: cd cli && go mod download
- name: Check formatting
if: matrix.os == 'ubuntu-latest'
run: |
test -z "$(gofmt -l cli/cmd cli/internal)" || (echo "Files not formatted:"; gofmt -l cli/cmd cli/internal; exit 1)
- name: Build
run: cd cli && go build -o ./bin/yapi ./cmd/yapi
- name: Test
run: cd cli && go test ./...
# - name: Fuzz tests
# run: go run ./scripts/fuzz.go
# env:
# FUZZTIME: 10s