|
14 | 14 | required: false
|
15 | 15 | default: 'none'
|
16 | 16 |
|
17 |
| -env: |
18 |
| - cwd: ${{github.workspace}}/packages/binarytree |
19 |
| - |
20 |
| -# Removed defaults.run.working-directory - commands run from root with pnpm filters |
| 17 | +# No default working-directory — we install at the repo root on purpose |
21 | 18 |
|
22 | 19 | concurrency:
|
23 | 20 | group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-binarytree
|
24 | 21 | cancel-in-progress: true
|
25 | 22 |
|
26 | 23 | jobs:
|
27 | 24 | test-binarytree:
|
28 |
| - runs-on: ubuntu-latest |
| 25 | + runs-on: ubuntu-24.04 |
29 | 26 |
|
30 | 27 | steps:
|
31 |
| - # We clone the repo and submodules if triggered from work-flow dispatch |
32 |
| - - if: inputs.submodule-cache-key == 'none' |
33 |
| - uses: actions/checkout@v4 |
34 |
| - |
35 |
| - # We restore the code/deps from cache if triggered from workflow_call (i.e. have valid cache key) |
36 |
| - - if: inputs.dep-cache-key != 'none' |
37 |
| - uses: actions/cache/restore@v4 |
38 |
| - id: dep-cache |
| 28 | + # Always check out the repository (don't rely on restoring the whole workspace from cache) |
| 29 | + - uses: actions/checkout@v5 |
39 | 30 | with:
|
40 |
| - path: ${{github.workspace}} |
41 |
| - key: ${{ inputs.dep-cache-key }} |
| 31 | + submodules: recursive |
42 | 32 |
|
43 |
| - - uses: pnpm/action-setup@v4 |
| 33 | + # Install pnpm first so setup-node's cache: 'pnpm' can find it |
| 34 | + - name: Install pnpm |
| 35 | + uses: pnpm/action-setup@v4 |
44 | 36 | with:
|
45 |
| - version: 10.5.2 |
| 37 | + # Use 'auto' if your root package.json has: { "packageManager": "pnpm@<version>" } |
| 38 | + version: auto |
46 | 39 | run_install: false
|
47 | 40 |
|
48 |
| - - name: Use Node.js 20 |
| 41 | + - name: Setup Node.js 20 (with pnpm store cache) |
49 | 42 | uses: actions/setup-node@v5
|
50 | 43 | with:
|
51 |
| - node-version: 20 |
| 44 | + node-version: '20' |
52 | 45 | cache: 'pnpm'
|
53 | 46 |
|
54 |
| - - name: Sanity check repo root |
55 |
| - run: | |
56 |
| - pwd |
57 |
| - ls -la |
58 |
| - test -f package.json && echo "Found package.json at root" || (echo "Missing package.json at root" && exit 1) |
59 |
| - test -f pnpm-workspace.yaml && echo "Found pnpm-workspace.yaml" || echo "No pnpm-workspace.yaml (ok if not a workspace)" |
60 |
| - pnpm -v |
61 |
| - command -v pnpm |
62 |
| -
|
63 |
| - - name: Install Dependencies (if not restored from cache) |
64 |
| - if: steps.dep-cache.outputs.cache-hit != 'true' |
65 |
| - run: pnpm install --frozen-lockfile --prefer-offline |
| 47 | + # Install dependencies from the WORKSPACE ROOT |
| 48 | + - name: Install dependencies (workspace) |
66 | 49 | working-directory: ${{ github.workspace }}
|
| 50 | + run: pnpm install --frozen-lockfile |
| 51 | + |
| 52 | + # Build only the binarytree package |
| 53 | + - name: Build @ethereumjs/binarytree |
| 54 | + run: pnpm -w -r --filter "@ethereumjs/binarytree" run build |
67 | 55 |
|
68 |
| - - name: Test binarytree |
69 |
| - run: pnpm -w -r --filter @ethereumjs/binarytree run test |
| 56 | + # Test only the binarytree package |
| 57 | + - name: Test @ethereumjs/binarytree |
| 58 | + run: pnpm -w -r --filter "@ethereumjs/binarytree" run test |
0 commit comments