|
1 | | -# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node |
2 | | -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions |
3 | | - |
4 | 1 | name: Test |
5 | 2 |
|
6 | 3 | on: |
|
9 | 6 | pull_request: |
10 | 7 | branches: [main] |
11 | 8 |
|
| 9 | +permissions: |
| 10 | + contents: read |
| 11 | + |
12 | 12 | jobs: |
13 | 13 | test: |
14 | 14 | name: Unit tests |
15 | 15 | runs-on: ubuntu-latest |
16 | 16 | steps: |
17 | | - - uses: actions/checkout@v6 |
| 17 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 |
| 18 | + with: |
| 19 | + persist-credentials: false |
| 20 | + - uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6 |
18 | 21 | - name: Use Node.js |
19 | | - uses: actions/setup-node@v6 |
| 22 | + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 |
20 | 23 | with: |
21 | | - cache: 'npm' |
22 | | - node-version: 22 |
23 | | - - name: Install dependencies |
24 | | - run: npm ci --ignore-scripts --no-audit --no-fund |
| 24 | + node-version: 24 |
| 25 | + cache: pnpm |
| 26 | + - run: pnpm install --frozen-lockfile |
25 | 27 | - name: Install Playwright Browsers |
26 | | - run: npx playwright install chromium --only-shell |
27 | | - - run: npm test -- --forbid-only |
| 28 | + run: pnpm exec playwright install chromium --only-shell |
| 29 | + - run: pnpm test --forbid-only |
28 | 30 | - name: Upload coverage reports to Codecov |
29 | | - uses: codecov/codecov-action@v6 |
| 31 | + uses: codecov/codecov-action@75cd11691c0faa626561e295848008c8a7dddffe # v5 |
30 | 32 | with: |
31 | 33 | token: ${{ secrets.CODECOV_TOKEN }} |
32 | 34 |
|
33 | 35 | check-ts: |
34 | 36 | name: Check types |
35 | 37 | runs-on: ubuntu-latest |
36 | 38 | steps: |
37 | | - - uses: actions/checkout@v6 |
| 39 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 |
| 40 | + with: |
| 41 | + persist-credentials: false |
| 42 | + - uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6 |
38 | 43 | - name: Use Node.js |
39 | | - uses: actions/setup-node@v6 |
| 44 | + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 |
40 | 45 | with: |
41 | | - cache: 'npm' |
42 | | - node-version: 22 |
43 | | - - run: npm ci --ignore-scripts --no-audit --no-fund |
44 | | - - run: npm run check |
| 46 | + node-version: 24 |
| 47 | + cache: pnpm |
| 48 | + - run: pnpm install --frozen-lockfile |
| 49 | + - run: pnpm run check |
45 | 50 |
|
46 | 51 | lint-code: |
47 | 52 | name: Lint code (oxlint) |
48 | 53 | runs-on: ubuntu-latest |
49 | 54 | steps: |
50 | | - - uses: actions/checkout@v6 |
| 55 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 |
| 56 | + with: |
| 57 | + persist-credentials: false |
| 58 | + - uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6 |
51 | 59 | - name: Use Node.js |
52 | | - uses: actions/setup-node@v6 |
| 60 | + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 |
53 | 61 | with: |
54 | | - cache: 'npm' |
55 | | - node-version: 22 |
56 | | - - run: npm ci --ignore-scripts --no-audit --no-fund |
57 | | - - run: npm run lint |
| 62 | + node-version: 24 |
| 63 | + cache: pnpm |
| 64 | + - run: pnpm install --frozen-lockfile |
| 65 | + - run: pnpm run lint |
58 | 66 |
|
59 | 67 | declutter-code: |
60 | 68 | name: Declutter code (Knip) |
61 | 69 | runs-on: ubuntu-latest |
62 | 70 | steps: |
63 | | - - uses: actions/checkout@v6 |
| 71 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 |
| 72 | + with: |
| 73 | + persist-credentials: false |
| 74 | + - uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6 |
64 | 75 | - name: Use Node.js |
65 | | - uses: actions/setup-node@v6 |
| 76 | + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 |
66 | 77 | with: |
67 | | - cache: 'npm' |
68 | | - node-version: 22 |
69 | | - - run: npm ci --ignore-scripts --no-audit --no-fund |
70 | | - - run: npm run knip |
| 78 | + node-version: 24 |
| 79 | + cache: pnpm |
| 80 | + - run: pnpm install --frozen-lockfile |
| 81 | + - run: pnpm run knip |
71 | 82 |
|
72 | 83 | bundle-analysis: |
73 | 84 | name: Report bundle analysis (codecov) |
74 | 85 | runs-on: ubuntu-latest |
75 | 86 | steps: |
76 | | - - uses: actions/checkout@v6 |
77 | | - - uses: actions/setup-node@v6 |
| 87 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 |
| 88 | + with: |
| 89 | + persist-credentials: false |
| 90 | + - uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6 |
| 91 | + - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 |
78 | 92 | with: |
79 | | - cache: 'npm' |
80 | | - node-version: 22 |
81 | | - - run: npm ci --ignore-scripts --no-audit --no-fund |
82 | | - - run: npm run build |
| 93 | + node-version: 24 |
| 94 | + cache: pnpm |
| 95 | + - run: pnpm install --frozen-lockfile |
| 96 | + - run: pnpm run build |
83 | 97 | env: |
84 | 98 | CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
85 | 99 |
|
86 | | - npm-audit: |
| 100 | + audit: |
87 | 101 | name: Audit packages |
88 | 102 | runs-on: ubuntu-latest |
89 | 103 | steps: |
90 | 104 | - name: Checkout code |
91 | | - uses: actions/checkout@v6 |
| 105 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 |
| 106 | + - uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6 |
92 | 107 | - name: Use Node.js |
93 | | - uses: actions/setup-node@v6 |
| 108 | + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 |
94 | 109 | with: |
95 | | - cache: 'npm' |
96 | | - node-version: 22 |
97 | | - - run: npm audit --audit-level=high |
| 110 | + node-version: 24 |
| 111 | + cache: pnpm |
| 112 | + - run: pnpm install --frozen-lockfile |
| 113 | + - run: pnpm audit --audit-level=high |
0 commit comments