|
7 | 7 | runs-on: ubuntu-latest |
8 | 8 | steps: |
9 | 9 | - name: Checkout repository |
10 | | - uses: actions/checkout@v4 |
| 10 | + uses: actions/checkout@v6 |
11 | 11 |
|
12 | | - - name: Use Node.js 20.17.0 |
13 | | - uses: actions/setup-node@v4 |
| 12 | + - name: Use Node.js |
| 13 | + uses: actions/setup-node@v6 |
14 | 14 | with: |
15 | | - node-version: '20.17.0' |
| 15 | + node-version-file: '.nvmrc' |
16 | 16 | cache: 'npm' |
17 | 17 |
|
18 | 18 | - name: Install dependencies |
19 | 19 | run: npm ci |
20 | 20 |
|
21 | | - - name: Build |
22 | | - run: npm run build |
| 21 | + - name: Install test browsers |
| 22 | + run: node --run install:test-browsers |
| 23 | + |
| 24 | + - name: Lint |
| 25 | + run: node --run lint |
23 | 26 |
|
24 | 27 | - name: Check TypeScript types |
25 | | - run: npm run tsc-check |
| 28 | + run: node --run check-types |
| 29 | + |
| 30 | + - name: Build |
| 31 | + run: node --run build |
26 | 32 |
|
27 | 33 | - name: Run tests |
28 | | - run: npm test |
| 34 | + run: node --run test |
29 | 35 |
|
30 | 36 | e2e-tests: |
31 | 37 | runs-on: ubuntu-latest |
32 | 38 | steps: |
33 | 39 | - name: Checkout repository |
34 | | - uses: actions/checkout@v4 |
| 40 | + uses: actions/checkout@v6 |
35 | 41 |
|
36 | | - - name: Use Node.js 20.17.0 |
37 | | - uses: actions/setup-node@v4 |
| 42 | + - name: Use Node.js |
| 43 | + uses: actions/setup-node@v6 |
38 | 44 | with: |
39 | | - node-version: '20.17.0' |
| 45 | + node-version-file: '.nvmrc' |
40 | 46 | cache: 'npm' |
41 | 47 |
|
42 | 48 | - name: Install dependencies |
43 | 49 | run: npm ci |
44 | 50 |
|
45 | | - - name: Build |
46 | | - run: npm run build |
| 51 | + - name: Install test browsers |
| 52 | + run: node --run install:test-browsers |
47 | 53 |
|
48 | | - - name: Check TypeScript types |
49 | | - run: npm run tsc-check |
| 54 | + - name: Build |
| 55 | + run: node --run build |
50 | 56 |
|
51 | 57 | - name: Run E2E tests |
52 | | - run: npm run ci:e2e |
| 58 | + run: node --run ci:e2e |
| 59 | + |
| 60 | + changeset-check: |
| 61 | + if: github.event.pull_request.base.ref != 'main' |
| 62 | + runs-on: ubuntu-latest |
| 63 | + steps: |
| 64 | + - name: Checkout repository |
| 65 | + uses: actions/checkout@v6 |
| 66 | + with: |
| 67 | + fetch-depth: 0 |
| 68 | + |
| 69 | + - name: Check for changeset |
| 70 | + run: | |
| 71 | + BASE=${{ github.event.pull_request.base.sha }} |
| 72 | + HEAD=${{ github.event.pull_request.head.sha }} |
| 73 | +
|
| 74 | + PACKAGES_CHANGED=$(git diff --name-only "$BASE" "$HEAD" -- packages/ | head -1) |
| 75 | +
|
| 76 | + if [ -n "$PACKAGES_CHANGED" ]; then |
| 77 | + CHANGESET_ADDED=$(git diff --name-only "$BASE" "$HEAD" -- '.changeset/*.md' | head -1) |
| 78 | + if [ -z "$CHANGESET_ADDED" ]; then |
| 79 | + echo "::error::This PR modifies packages/ but has no changeset. Run 'node --run changeset' to add one." |
| 80 | + exit 1 |
| 81 | + fi |
| 82 | + echo "Changeset found for package changes." |
| 83 | + else |
| 84 | + echo "No package changes detected, skipping changeset check." |
| 85 | + fi |
0 commit comments