fix: sync ESLint and Prettier configurations #3
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: PR Validation | ||
|
Check failure on line 1 in .github/workflows/pr-validation.yml
|
||
| on: | ||
| pull_request: | ||
| branches: [ master ] | ||
| jobs: | ||
| validate: | ||
| name: Validate PR | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Use Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '22.x' | ||
| cache: 'npm' | ||
| - name: Install dependencies | ||
| run: npm ci | ||
| - name: Run lint | ||
| run: npm run lint | ||
| - name: Check formatting | ||
| run: npx prettier --check "packages/**/*.{ts,json}" | ||
| - name: Type check | ||
| run: | | ||
| set -e | ||
| for dir in packages/*/; do | ||
| if [ -f "$dir/tsconfig.build.json" ]; then | ||
| cd "$dir" | ||
| npx tsc --noEmit -p tsconfig.build.json || exit 1 | ||
| cd ../.. | ||
| fi | ||
| done | ||
| - name: Build | ||
| run: npm run build | ||
| - name: Run tests | ||
| run: npm test | ||
| env: | ||
| CI: true | ||
| - name: Comment PR | ||
| uses: actions/github-script@v7 | ||
| if: always() | ||
| with: | ||
| script: | | ||
| const status = '${{ job.status }}' === 'success' ? '✅' : '❌'; | ||
| const body = `## PR Validation Results ${status} | ||
| - **Lint**: ${{ job.status === 'success' ? '✅ Passed' : '❌ Failed' }} | ||
| - **Format**: ${{ job.status === 'success' ? '✅ Passed' : '❌ Failed' }} | ||
| - **Type Check**: ${{ job.status === 'success' ? '✅ Passed' : '❌ Failed' }} | ||
| - **Build**: ${{ job.status === 'success' ? '✅ Passed' : '❌ Failed' }} | ||
| - **Tests**: ${{ job.status === 'success' ? '✅ Passed' : '❌ Failed' }} | ||
| [View workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})`; | ||
| github.rest.issues.createComment({ | ||
| issue_number: context.issue.number, | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| body: body | ||
| }); | ||