chore: wip #380
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: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| zig-core: | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Pantry (provides Bun, Zig, etc.) | |
| uses: home-lang/pantry/packages/action@main | |
| - name: Verify Zig installation | |
| run: zig version | |
| - name: Cache Zig artifacts | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cache/zig | |
| packages/zig/.zig-cache | |
| key: ${{ runner.os }}-zig-master-${{ hashFiles('packages/zig/build.zig') }} | |
| restore-keys: | | |
| ${{ runner.os }}-zig-master- | |
| - name: Install Linux dependencies | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev | |
| - name: Build Zig core | |
| working-directory: packages/zig | |
| run: zig build | |
| - name: Check binary size | |
| if: runner.os == 'Linux' | |
| run: | | |
| ls -lh packages/zig/zig-out/bin/ | |
| size packages/zig/zig-out/bin/craft || true | |
| typescript-sdk: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Pantry (provides Bun, Zig, etc.) | |
| uses: home-lang/pantry/packages/action@main | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Type check TypeScript SDK | |
| working-directory: packages/typescript | |
| run: bun run typecheck | |
| - name: Run TypeScript SDK tests with coverage | |
| working-directory: packages/typescript | |
| run: bun test --coverage | |
| - name: Generate coverage summary | |
| if: always() | |
| working-directory: packages/typescript | |
| run: | | |
| echo "## TypeScript SDK Coverage" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| if [ -f coverage/coverage-summary.json ]; then | |
| cat coverage/coverage-summary.json | jq -r '.total | "- Lines: \(.lines.pct)%\n- Statements: \(.statements.pct)%\n- Functions: \(.functions.pct)%\n- Branches: \(.branches.pct)%"' >> $GITHUB_STEP_SUMMARY | |
| else | |
| echo "Coverage data not available" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| - name: Build TypeScript SDK | |
| working-directory: packages/typescript | |
| run: bun run build | |
| create-craft: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Pantry (provides Bun, Zig, etc.) | |
| uses: home-lang/pantry/packages/action@main | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Type check create-craft | |
| working-directory: packages/create-craft | |
| run: bun run typecheck | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Pantry (provides Bun, Zig, etc.) | |
| uses: home-lang/pantry/packages/action@main | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Check Zig formatting | |
| working-directory: packages/zig | |
| run: zig fmt --check src/ build.zig | |
| - name: Run pickier (lint + format check) | |
| run: bun run lint | |
| integration: | |
| runs-on: ubuntu-latest | |
| needs: [zig-core, typescript-sdk, create-craft] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Pantry (provides Bun, Zig, etc.) | |
| uses: home-lang/pantry/packages/action@main | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Install Linux dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev | |
| - name: Build Zig core | |
| working-directory: packages/zig | |
| run: zig build | |
| - name: Build TypeScript SDK | |
| working-directory: packages/typescript | |
| run: bun run build | |
| - name: Test TypeScript SDK with binary | |
| working-directory: packages/typescript | |
| run: bun test | |
| publish-commit: | |
| needs: [zig-core, typescript-sdk, create-craft, lint, integration] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Pantry (provides Bun, Zig, etc.) | |
| uses: home-lang/pantry/packages/action@main | |
| - name: Install Dependencies | |
| run: bun install | |
| - name: Build TypeScript SDK | |
| working-directory: packages/typescript | |
| run: bun run build | |
| - name: Publish Commit | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| run: pantry publish:commit './packages/typescript' | |
| env: | |
| PANTRY_REGISTRY_TOKEN: ${{ secrets.PANTRY_TOKEN }} |