name: CI Flow on: push: branches: - master pull_request: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: permissions: pages: write id-token: write concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: build: runs-on: ${{ matrix.os }} name: CI ${{ matrix.os }} Node ${{ matrix.node }} strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] node: [24, 26] # Set an environment variable to distinguish cache for each OS/Node # and distinguish between CI matrix runs in turbo.json env: TURBO_OS_ENV: ${{ matrix.os }} TURBO_NODE_ENV: ${{ matrix.node }} steps: - name: Checkout uses: actions/checkout@v7 - name: Setup pnpm, node and install packages uses: pnpm/setup@v3 with: runtime: node@${{ matrix.node }} cache: true require-lockfile: true - run: echo "Using Node $(node --version) on ${{ matrix.os }}" - name: Check versions run: pnpm change check - name: Build run: pnpm build-all - name: Check types run: pnpm test-types - name: Test run: pnpm test - name: Publish to Codecov uses: codecov/codecov-action@v7 if: ${{ matrix.os != 'windows-latest' }} with: # Codecov backend may be unstable fail_ci_if_error: false token: ${{ secrets.CODECOV_TOKEN }} deploy-docs: needs: build if: ${{ github.head_ref == 'next' || github.ref == 'refs/heads/master' }} runs-on: ubuntu-latest name: Deploy Docs environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} steps: - name: Checkout uses: actions/checkout@v7 - name: Setup pnpm, node and install packages uses: pnpm/setup@v3 with: node-version-file: .nvmrc cache: true require-lockfile: true - name: Cache turbo build setup uses: actions/cache@v6 with: path: .turbo key: ${{ runner.os }}-turbo-${{ github.sha }} restore-keys: | ${{ runner.os }}-turbo- - name: Build docs run: pnpm turbo build -F @kitajs/docs-html - name: Upload artifact uses: actions/upload-pages-artifact@v5 with: path: packages/docs/dist - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v5