Threads 21: Add the interactive thread playground #1851
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 | |
| on: | |
| pull_request: | |
| concurrency: | |
| group: lint-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Check affected | |
| id: affected | |
| shell: bash | |
| env: | |
| TURBO_SCM_BASE: ${{ github.event.pull_request.base.sha }} | |
| TURBO_SCM_HEAD: ${{ github.event.pull_request.head.sha }} | |
| run: | | |
| set -euo pipefail | |
| TURBO_VERSION="$(node -p "require('./package.json').devDependencies.turbo")" | |
| if npx -y "turbo@${TURBO_VERSION}" query affected --tasks lint --exit-code >/tmp/lint-query.json 2>/tmp/lint-query.log; then | |
| echo "run=false" >>"$GITHUB_OUTPUT" | |
| else | |
| status=$? | |
| if [ "$status" -eq 1 ]; then | |
| echo "run=true" >>"$GITHUB_OUTPUT" | |
| else | |
| cat /tmp/lint-query.log | |
| cat /tmp/lint-query.json | |
| exit "$status" | |
| fi | |
| fi | |
| - uses: oven-sh/setup-bun@v2 | |
| if: steps.affected.outputs.run == 'true' | |
| with: | |
| bun-version: 1.3.1 | |
| - uses: actions/cache@v4 | |
| if: steps.affected.outputs.run == 'true' | |
| with: | |
| path: ~/.bun/install/cache | |
| key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }} | |
| restore-keys: ${{ runner.os }}-bun- | |
| - if: steps.affected.outputs.run == 'true' | |
| run: bun install --frozen-lockfile | |
| - if: steps.affected.outputs.run == 'true' | |
| env: | |
| TURBO_SCM_BASE: ${{ github.event.pull_request.base.sha }} | |
| TURBO_SCM_HEAD: ${{ github.event.pull_request.head.sha }} | |
| run: bunx turbo run lint --affected |