|
1 | | -name: Code Style Check |
| 1 | +name: Prettier Check |
2 | 2 |
|
3 | | -on: [push, pull_request_target] |
| 3 | +on: [push, pull_request] |
4 | 4 |
|
5 | 5 | jobs: |
6 | | - eslint_check_upload: |
7 | | - runs-on: ubuntu-latest |
8 | | - permissions: |
9 | | - contents: read |
10 | | - name: ESLint Check and Report Upload |
11 | | - |
12 | | - steps: |
13 | | - - uses: actions/checkout@v4 |
14 | | - with: |
15 | | - repository: ${{ github.event.pull_request.head.repo.full_name }} |
16 | | - ref: ${{ github.head_ref }} |
17 | | - - name: Setup Node |
18 | | - uses: actions/setup-node@v3 |
19 | | - with: |
20 | | - node-version: lts/* |
21 | | - cache: 'yarn' |
22 | | - - name: Install Dependencies |
23 | | - run: yarn install --frozen-lockfile |
24 | | - env: |
25 | | - PUPPETEER_SKIP_DOWNLOAD: true |
26 | | - - name: Build Packages |
27 | | - run: NODE_OPTIONS='--max-old-space-size=4096' yarn build:all |
28 | | - - name: Eslint Check |
29 | | - run: yarn turbo run lint |
30 | | - - name: Save Code Linting Report JSON |
31 | | - run: yarn lint:report |
32 | | - # Continue to the next step even if this fails |
33 | | - continue-on-error: true |
34 | | - - name: Upload ESLint Report |
35 | | - uses: actions/upload-artifact@v4 |
36 | | - with: |
37 | | - name: eslint_report.json |
38 | | - path: eslint_report.json |
39 | | - |
40 | | - annotation: |
41 | | - # Skip the annotation action in push events |
42 | | - if: github.event_name == 'pull_request_target' |
43 | | - permissions: |
44 | | - checks: write |
45 | | - needs: eslint_check_upload |
46 | | - runs-on: ubuntu-latest |
47 | | - name: ESLint Annotation |
48 | | - steps: |
49 | | - - uses: actions/download-artifact@v4 |
50 | | - with: |
51 | | - name: eslint_report.json |
52 | | - - name: Annotate Code Linting Results |
53 | | - uses: ataylorme/eslint-annotate-action@v2 |
54 | | - with: |
55 | | - repo-token: '${{ secrets.GITHUB_TOKEN }}' |
56 | | - report-json: 'eslint_report.json' |
57 | | - |
58 | | - bundle_size: |
59 | | - # Only runs on PRs (needs a base branch to compare against) |
60 | | - if: github.event_name == 'pull_request_target' |
61 | | - runs-on: ubuntu-latest |
62 | | - permissions: |
63 | | - contents: read |
64 | | - pull-requests: write |
65 | | - name: Check Bundle Sizes |
66 | | - steps: |
67 | | - - uses: actions/checkout@v4 |
68 | | - with: |
69 | | - repository: ${{ github.event.pull_request.head.repo.full_name }} |
70 | | - ref: ${{ github.head_ref }} |
71 | | - - name: Setup Node |
72 | | - uses: actions/setup-node@v3 |
73 | | - with: |
74 | | - node-version: lts/* |
75 | | - cache: 'yarn' |
76 | | - - name: Check bundle sizes |
77 | | - uses: preactjs/compressed-size-action@v2 |
78 | | - with: |
79 | | - install-script: 'yarn install --frozen-lockfile' |
80 | | - build-script: 'build:all' |
81 | | - compression: 'none' |
82 | | - pattern: '**/dist/*.{js,cjs,mjs,css}' |
83 | | - env: |
84 | | - PUPPETEER_SKIP_DOWNLOAD: true |
85 | | - |
86 | 6 | prettier_check: |
87 | 7 | # In the forked PR, it's hard to format code and push to the branch directly, so the action only check the format correctness. |
88 | 8 | if: github.event_name != 'push' && github.event.pull_request.head.repo.full_name != 'rrweb-io/rrweb' |
|
0 commit comments