preview-release #402
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |