Migrate from Yarn to pnpm #36305
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: Lint, and Test | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| jobs: | |
| job_lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/[email protected] | |
| - name: Internal github app token | |
| id: token | |
| uses: getsentry/action-github-app-token@97c9e23528286821f97fba885c1b1123284b29cc # v2.0.0 | |
| continue-on-error: true | |
| with: | |
| app_id: ${{ vars.SENTRY_INTERNAL_APP_ID }} | |
| private_key: ${{ secrets.SENTRY_INTERNAL_APP_PRIVATE_KEY }} | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4 | |
| id: setup-node | |
| with: | |
| node-version-file: 'package.json' | |
| cache: 'pnpm' | |
| - run: pnpm install --frozen-lockfile | |
| # Additional checks | |
| - run: pnpm lint:ts | |
| - run: pnpm lint:docs | |
| # Run automatic fixes (run prettier apart from eslint to also fix mdx files) | |
| - run: pnpm lint:prettier:fix | |
| - run: pnpm lint:eslint:fix | |
| # Check (and error) for dirty working tree for forks | |
| # Reason being we need a different token to auto commit changes and | |
| # forks do not have access to said token | |
| - name: Check for dirty git working tree (forks) | |
| if: steps.token.outcome != 'success' && github.ref != 'refs/heads/master' | |
| run: | | |
| git diff --quiet || (echo '::error ::lint produced file changes, run linter locally and try again' && exit 1) | |
| # If working tree is dirty, commit and update if we have a token | |
| - name: Commit any eslint fixed files | |
| if: steps.token.outcome == 'success' && github.ref != 'refs/heads/master' | |
| uses: getsentry/action-github-commit@5972d5f578ad77306063449e718c0c2a6fbc4ae1 # main | |
| with: | |
| github-token: ${{ steps.token.outputs.token }} | |
| job_test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/[email protected] | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - name: Set up Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: 'package.json' | |
| cache: 'pnpm' | |
| - run: pnpm install --frozen-lockfile | |
| - name: Run Tests | |
| run: pnpm test |