chore: switch to pnpm monorepo #672
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, next] | |
| pull_request: | |
| branches: [main, next] | |
| schedule: | |
| # Tuesdays at 14:45 UTC (10:45 EST) | |
| - cron: 45 14 * * 1 | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| main: | |
| # ignore all-contributors PRs | |
| if: ${{ !contains(github.head_ref, 'all-contributors') }} | |
| name: Svelte ${{ matrix.svelte }}, Node ${{ matrix.node }}, ${{ matrix.check }} | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| # enable OIDC for codecov uploads | |
| permissions: | |
| id-token: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node: ['16', '18', '20', '22'] | |
| svelte: ['3', '4', '5'] | |
| check: ['test:vitest:jsdom', 'test:vitest:happy-dom', 'test:jest'] | |
| exclude: | |
| # Don't run Svelte 3 on Node versions greater than 20 | |
| - { svelte: '3', node: '22' } | |
| # Only run Svelte 5 on Node versions greater than or equal to 20 | |
| - { svelte: '5', node: '16' } | |
| - { svelte: '5', node: '18' } | |
| include: | |
| # Only lint and test examples on latest Node and Svelte | |
| - { svelte: '5', node: '22', check: 'lint' } | |
| - { svelte: '5', node: '22', check: 'test:examples' } | |
| # Run type checks in latest applicable Node | |
| - { svelte: '3', node: '20', check: 'types:legacy' } | |
| - { svelte: '4', node: '22', check: 'types:legacy' } | |
| - { svelte: '5', node: '22', check: 'types' } | |
| steps: | |
| - name: ⬇️ Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: 🧱 Setup pnpm | |
| uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 | |
| - name: ⎔ Setup node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| - name: 📥 Download deps | |
| run: pnpm run install:${{ matrix.svelte }} | |
| - name: 📥 Download types build | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: build | |
| path: packages/svelte | |
| - name: ▶️ Run ${{ matrix.check }} | |
| run: pnpm run ${{ matrix.check }} | |
| - name: ⬆️ Upload coverage report | |
| if: ${{ startsWith(matrix.check, 'test:') }} | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| use_oidc: true | |
| fail_ci_if_error: true | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: ⬇️ Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: 🧱 Setup pnpm | |
| uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 | |
| - name: ⎔ Setup node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: 📥 Download deps | |
| run: pnpm install | |
| - name: 🏗️ Build types and docs | |
| run: pnpm run build | |
| - name: ⬆️ Upload build | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build | |
| path: | | |
| packages/svelte/README.md | |
| packages/svelte/types | |
| release: | |
| needs: [main, build] | |
| runs-on: ubuntu-latest | |
| if: ${{ github.repository == 'testing-library/svelte-testing-library' && | |
| contains('refs/heads/main,refs/heads/next', github.ref) && | |
| github.event_name == 'push' }} | |
| steps: | |
| - name: ⬇️ Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: ⎔ Setup node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: 📥 Download types build | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: build | |
| path: packages/svelte | |
| - name: 🚀 Release | |
| uses: cycjimmy/semantic-release-action@v4 | |
| with: | |
| semantic_version: 24 | |
| extra_plugins: | | |
| conventional-changelog-conventionalcommits@8 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |