feat(scaffold/test): watch mode for test #271
Workflow file for this run
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 | |
| tags: | |
| - v** | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GitHub_TOKEN }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: pnpm | |
| - name: Install deps | |
| run: | | |
| echo "public-hoist-pattern[]=@types*" >> .npmrc | |
| pnpm install | |
| - name: Lint | |
| run: | | |
| pnpm lint:check | |
| test: | |
| runs-on: ubuntu-latest | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GitHub_TOKEN }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: pnpm | |
| - name: Install deps | |
| run: | | |
| echo "public-hoist-pattern[]=@types*" >> .npmrc | |
| pnpm install | |
| - name: Test | |
| run: | | |
| pnpm test | |
| build: | |
| runs-on: ubuntu-latest | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GitHub_TOKEN }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: pnpm | |
| - name: Install deps | |
| run: | | |
| pnpm install | |
| - name: Build Packages | |
| run: | | |
| pnpm build | |
| - name: Upload build result | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-result | |
| path: | | |
| **/dist/ | |
| !**/node_modules | |
| docs: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GitHub_TOKEN }} | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Restore Build Result | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: build-result | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: pnpm | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v5 | |
| - name: Install deps | |
| run: | | |
| pnpm install | |
| - name: Build Documentation | |
| run: pnpm docs:build | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: docs/src/.vitepress/dist | |
| - name: Deploy to GitHub Pages | |
| if: github.event_name == 'push' | |
| id: deployment | |
| uses: actions/deploy-pages@v4 | |
| publish: | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' || github.event_name == 'pull_request' | |
| needs: | |
| - build | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GitHub_TOKEN }} | |
| NODE_AUTH_TOKEN: ${{secrets.npm_token}} | |
| permissions: | |
| contents: write | |
| issues: write | |
| pull-requests: write | |
| id-token: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Restore Build Result | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: build-result | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| registry-url: https://registry.npmjs.org/ | |
| cache: pnpm | |
| - name: Publish to NPM and sync to GitHub | |
| if: github.event_name == 'push' && github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/v') | |
| run: | | |
| pnpm -r publish --no-git-checks | |
| pnpx changelogithub | |
| env: | |
| NPM_CONFIG_PROVENANCE: true | |
| - name: Publish to pkg-pr-new | |
| if: github.ref_type != 'tag' | |
| run: pnpx pkg-pr-new publish --compact --no-template --pnpm './packages/*' |