|
1 | 1 | name: Setup CI dependencies |
2 | 2 | description: Install workspace dependencies and Playwright browsers for CI jobs. |
3 | 3 |
|
| 4 | +inputs: |
| 5 | + install-playwright: |
| 6 | + description: Install Playwright browser and system dependencies. |
| 7 | + default: 'true' |
| 8 | + |
4 | 9 | runs: |
5 | 10 | using: composite |
6 | 11 | steps: |
7 | | - - uses: pnpm/action-setup@8912a9102ac27614460f54aedde9e1e7f9aec20d |
8 | | - with: |
9 | | - version: 11.0.8 |
10 | | - run_install: false |
11 | | - - uses: actions/setup-node@v6 |
| 12 | + - uses: jdx/mise-action@e6a8b3978addb5a52f2b4cd9d91eafa7f0ab959d |
12 | 13 | with: |
13 | | - node-version-file: './.nvmrc' |
14 | | - registry-url: 'https://registry.npmjs.org' |
15 | | - cache: 'pnpm' |
16 | | - - uses: actions/setup-go@v6 |
| 14 | + version: 2026.6.14 |
| 15 | + install: true |
| 16 | + cache: true |
| 17 | + - name: Configure npm registry |
| 18 | + shell: bash |
| 19 | + run: | |
| 20 | + { |
| 21 | + echo "registry=https://registry.npmjs.org/" |
| 22 | + if [[ -n "${NODE_AUTH_TOKEN:-}" ]]; then |
| 23 | + echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" |
| 24 | + fi |
| 25 | + } > "$HOME/.npmrc" |
| 26 | + - name: Resolve pnpm store path |
| 27 | + id: pnpm-store |
| 28 | + shell: bash |
| 29 | + run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT" |
| 30 | + - name: Cache pnpm store |
| 31 | + uses: actions/cache@v5 |
17 | 32 | with: |
18 | | - go-version: '1.26.x' |
19 | | - cache: false |
| 33 | + path: ${{ steps.pnpm-store.outputs.path }} |
| 34 | + key: ${{ runner.os }}-${{ runner.arch }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}-v1 |
| 35 | + restore-keys: ${{ runner.os }}-${{ runner.arch }}-pnpm-store- |
20 | 36 | - name: Install dependencies |
21 | 37 | shell: bash |
22 | 38 | run: pnpm install --frozen-lockfile |
23 | | - - name: Cache Vale |
| 39 | + - name: Cache Vale styles |
24 | 40 | uses: actions/cache@v5 |
25 | 41 | with: |
26 | 42 | path: | |
27 | | - config/vale/bin |
28 | 43 | config/vale/styles/Google |
29 | 44 | config/vale/styles/write-good |
30 | | - key: ${{ runner.os }}-${{ runner.arch }}-vale-${{ hashFiles('.vale.ini', 'config/vale/install.mjs') }}-v1 |
31 | | - - name: Install Vale |
| 45 | + key: ${{ runner.os }}-${{ runner.arch }}-vale-styles-${{ hashFiles('.vale.ini') }}-v1 |
| 46 | + - name: Sync Vale styles |
32 | 47 | shell: bash |
33 | | - run: node config/vale/install.mjs |
| 48 | + run: vale sync |
34 | 49 | - name: Resolve Playwright version |
| 50 | + if: inputs.install-playwright == 'true' |
35 | 51 | id: playwright-version |
36 | 52 | shell: bash |
37 | 53 | run: echo "version=$(node -p 'require("./node_modules/playwright/package.json").version')" >> "$GITHUB_OUTPUT" |
38 | 54 | - name: Cache Playwright browsers |
| 55 | + if: inputs.install-playwright == 'true' |
39 | 56 | id: cache-playwright |
40 | 57 | uses: actions/cache@v5 |
41 | 58 | with: |
42 | 59 | path: ~/.cache/ms-playwright |
43 | 60 | key: ${{ runner.os }}-${{ runner.arch }}-playwright-chromium-shell-${{ steps.playwright-version.outputs.version }}-v1 |
44 | | - - uses: actions/setup-node@v6 |
45 | | - with: |
46 | | - node-version: 24 |
47 | 61 | - name: Install Playwright system dependencies |
| 62 | + if: inputs.install-playwright == 'true' |
48 | 63 | shell: bash |
49 | 64 | run: node ./node_modules/playwright/cli.js install-deps chromium |
50 | 65 | - name: Install Playwright Chromium |
51 | | - if: steps.cache-playwright.outputs.cache-hit != 'true' |
| 66 | + if: inputs.install-playwright == 'true' && steps.cache-playwright.outputs.cache-hit != 'true' |
52 | 67 | shell: bash |
53 | 68 | run: node ./node_modules/playwright/cli.js install --only-shell chromium |
54 | | - - uses: actions/setup-node@v6 |
55 | | - with: |
56 | | - node-version-file: './.nvmrc' |
57 | | - registry-url: 'https://registry.npmjs.org' |
|
0 commit comments