Skip to content

Commit 147a363

Browse files
committed
fix: update pr-preview workflow to use yarn 4 with corepack
1 parent 16c4aad commit 147a363

1 file changed

Lines changed: 22 additions & 17 deletions

File tree

.github/workflows/pr-preview.yml

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,31 +28,36 @@ jobs:
2828
- uses: actions/setup-node@v4
2929
with:
3030
node-version: '20'
31+
- name: Enable Corepack and install correct Yarn version
32+
shell: bash
33+
run: |
34+
corepack enable
35+
corepack prepare yarn@4.10.3 --activate
3136
- uses: actions/cache@v4
32-
id: npm-cache
33-
name: Load npm deps from cache
37+
id: yarn-cache
38+
name: Load yarn deps from cache
3439
with:
35-
path: '**/node_modules'
36-
key: ${{ runner.os }}-npm-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('package-lock.json') }}
37-
- run: npm install --frozen-lockfile --legacy-peer-deps
40+
path: |
41+
node_modules
42+
**/node_modules
43+
key: ${{ runner.os }}-yarn-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }}
44+
- run: yarn install --immutable
3845
if: steps.yarn-cache.outputs.cache-hit != 'true'
39-
- run: npm run build
46+
- run: yarn build
4047
name: Build component groups
4148
- uses: actions/cache@v4
4249
id: docs-cache
4350
name: Load webpack cache
4451
with:
4552
path: '.cache'
4653
key: ${{ runner.os }}-v4-${{ hashFiles('yarn.lock') }}
47-
- run: npm run build:docs
54+
- run: yarn build:docs
4855
name: Build docs
49-
- run: node .github/upload-preview.js packages/module/public
50-
name: Upload docs
51-
if: always()
52-
- run: npx puppeteer browsers install chrome
53-
name: Install Chrome for Puppeteer
54-
- run: npm run serve:docs & npm run test:a11y
55-
name: a11y tests
56-
- run: node .github/upload-preview.js packages/module/coverage
57-
name: Upload a11y report
58-
if: always()
56+
- name: Deploy preview to surge
57+
if: env.SURGE_LOGIN != '' && env.SURGE_TOKEN != ''
58+
run: |
59+
npx surge packages/module/public --domain pr-${{ github.event.number }}-widgetized-dashboard.surge.sh
60+
- name: Install Chrome for Puppeteer
61+
run: npx puppeteer browsers install chrome
62+
- name: a11y tests
63+
run: yarn serve:docs & yarn test:a11y

0 commit comments

Comments
 (0)