|
1 | 1 | name: validate |
2 | 2 | on: |
3 | | - push: |
4 | | - branches: |
5 | | - - '+([0-9])?(.{+([0-9]),x}).x' |
6 | | - - 'main' |
7 | | - - 'next' |
8 | | - - 'next-major' |
9 | | - - 'beta' |
10 | | - - 'alpha' |
11 | | - - '!all-contributors/**' |
12 | 3 | pull_request: |
13 | 4 |
|
14 | 5 | concurrency: |
15 | 6 | group: ${{ github.workflow }}-${{ github.ref }} |
16 | 7 | cancel-in-progress: true |
17 | 8 |
|
| 9 | +permissions: {} |
| 10 | + |
18 | 11 | jobs: |
19 | 12 | main: |
| 13 | + permissions: |
| 14 | + contents: read # to fetch code (actions/checkout) |
20 | 15 | # ignore all-contributors PRs |
21 | 16 | if: ${{ !contains(github.head_ref, 'all-contributors') }} |
22 | 17 | strategy: |
| 18 | + fail-fast: false |
23 | 19 | matrix: |
24 | | - node: [16, 18, 20] |
| 20 | + node: [20, 22, 24] |
25 | 21 | runs-on: ubuntu-latest |
26 | 22 | steps: |
27 | 23 | - name: ⬇️ Checkout repo |
28 | | - uses: actions/checkout@v2 |
| 24 | + uses: actions/checkout@v4 |
29 | 25 |
|
30 | 26 | - name: ⎔ Setup node |
31 | | - uses: actions/setup-node@v2 |
| 27 | + uses: actions/setup-node@v4 |
32 | 28 | with: |
33 | 29 | node-version: ${{ matrix.node }} |
34 | 30 |
|
35 | 31 | - name: 📥 Download deps |
36 | 32 | uses: bahmutov/npm-install@v1 |
37 | 33 | with: |
38 | 34 | useLockFile: false |
39 | | - env: |
40 | | - HUSKY_SKIP_INSTALL: true |
41 | | - |
42 | | - - name: ▶️ Run validate script |
43 | | - run: npm run validate |
44 | | - |
45 | | - - name: ⬆️ Upload coverage report |
46 | | - uses: codecov/codecov-action@v2 |
47 | 35 |
|
48 | | - release: |
49 | | - needs: main |
50 | | - runs-on: ubuntu-latest |
51 | | - if: |
52 | | - ${{ github.repository == 'testing-library/preact-testing-library' && |
53 | | - contains('refs/heads/main,refs/heads/beta,refs/heads/next,refs/heads/alpha', github.ref) && |
54 | | - github.event_name == 'push' }} |
55 | | - steps: |
56 | | - - name: ⬇️ Checkout repo |
57 | | - uses: actions/checkout@v2 |
| 36 | + - name: 🧹 Run lint script |
| 37 | + run: npm run lint |
58 | 38 |
|
59 | | - - name: ⎔ Setup node |
60 | | - uses: actions/setup-node@v2 |
61 | | - with: |
62 | | - node-version: 14 |
| 39 | + - name: 🧪 Run tests with coverage |
| 40 | + run: npm test -- --coverage |
63 | 41 |
|
64 | | - - name: 📥 Download deps |
65 | | - uses: bahmutov/npm-install@v1 |
66 | | - with: |
67 | | - useLockFile: false |
68 | | - env: |
69 | | - HUSKY_SKIP_INSTALL: true |
| 42 | + - name: 🧼 Run clean script |
| 43 | + run: npm run clean |
70 | 44 |
|
71 | 45 | - name: 🏗 Run build script |
72 | 46 | run: npm run build |
73 | 47 |
|
74 | | - - name: 🚀 Release |
75 | | - uses: cycjimmy/semantic-release-action@v2 |
| 48 | + - name: ⬆️ Upload coverage report |
| 49 | + uses: codecov/codecov-action@v5 |
76 | 50 | with: |
77 | | - semantic_version: 17 |
78 | | - branches: | |
79 | | - [ |
80 | | - '+([0-9])?(.{+([0-9]),x}).x', |
81 | | - 'main', |
82 | | - 'next', |
83 | | - 'next-major', |
84 | | - {name: 'beta', prerelease: true}, |
85 | | - {name: 'alpha', prerelease: true} |
86 | | - ] |
87 | | - env: |
88 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
89 | | - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
| 51 | + fail_ci_if_error: false # Temp because token is invalid |
| 52 | + flags: node-${{ matrix.node }} |
| 53 | + token: ${{ secrets.CODECOV_TOKEN }} |
0 commit comments