Skip to content

Commit 64e4f55

Browse files
committed
chore: migrate from Yarn Classic to Yarn Berry
* Migrate Yarn to v4 release and cleanup plugins Replace Yarn Classic with the Yarn v4 release and update project config. Removed individual .yarn/plugins/*.cjs plugin files and added .yarn/releases/yarn-4.16.0.cjs; updated .yarnrc.yml and package.json to use the release, reordered .gitignore entries to ensure .yarn/releases is not ignored, and regenerated yarn.lock. * chore: use workspace:* for internal packages - Switch services to use the workspace:* protocol for internal packages (@guardian/common and @guardian/interfaces) to enable local monorepo resolution. Also normalize and tidy package.json entries across services. - Remove the pinned packageManager: yarn@1.22.21 entries from package.json files in analytics-service, api-gateway, auth-service, indexer-api-gateway, logger-service, and notification-service. This unpins Yarn v1 at the package level and defers package manager choice to workspace/CI configuration. * chore: Migrate Dockerfiles to Yarn Berry Replace the old pack/install multi-stage flow with a Yarn Berry workspaces-based build. Enable corepack, add deps-dev/build/deps-prod stages, use yarn workspaces run build for interfaces/common/services and yarn workspaces focus --production to install target-native production deps. Copy workspace package.json/dist outputs into the final image and use a shared yarn cache mount (/root/.yarn/berry/cache). Changes applied to simplify and speed up workspace builds. * chore: Use Corepack and yarn immutable in workflows - Replace the old Yarn setup steps with Corepack (corepack enable) - Update cache path to .yarn/cache, and switch yarn install to --immutable across CI workflow files. - Remove the ipfs-version matrix entries and hardcode ipfs_version: 0.41.0 in the IPFS setup steps. - Set YARN_ENABLE_GLOBAL_CACHE: 'false' in GitHub Actions jobs to disable Yarn's global cache during CI * chore: use local BuildKit cache in workflows Replace GH Actions registry cache with a local BuildKit cache at /tmp/buildkit-cache across API workflows. Updates cache-from to type=local,src=/tmp/buildkit-cache and cache-to to type=local,dest=/tmp/buildkit-cache,mode=min to use a local Docker buildx cache for the Cypress/Docker jobs. * docs: Update Node.js version and Yarn links Bump Node.js recommendation in README.md from v20.19 to v20.20 and replace legacy Yarn install URLs (classic.yarnpkg.com) with the current yarnpkg.com/getting-started/install links across README.md, contracts/README.md, and docs/guardian README. Documentation update to keep prerequisites and install links current; no code changes. * fix: Scope volume mounts under service subdirs Change docker-compose volume mount targets to include service-specific subdirectories under /usr/local/app (e.g. ./auth-service/configs -> /usr/local/app/auth-service/configs). Applied across all docker-compose variants * chore: bump actions/checkout to 6.0.3 in workflows Update actions/checkout references to the v6.0.3 commit (df4cb1c...) across GitHub Actions workflow files to pick up the latest fixes. --------- Signed-off-by: Alex Piatakov <alex.piatakov@swirldslabs.com>
1 parent cd44aaf commit 64e4f55

74 files changed

Lines changed: 20809 additions & 15152 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/add-documentation-to-repo.yaml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ jobs:
1010
runService:
1111
name: Run Service
1212
runs-on: guardian-linux-medium
13+
env:
14+
YARN_ENABLE_GLOBAL_CACHE: 'false'
1315
strategy:
1416
matrix:
1517
node-version: [ 20.20.2 ]
@@ -21,31 +23,25 @@ jobs:
2123
egress-policy: audit
2224

2325
- name: Checkout Code
24-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
26+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
2527

2628
- name: Use Node.js ${{ matrix.node-version }}
27-
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e #v6.4.0
29+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
2830
with:
2931
node-version: ${{ matrix.node-version }}
3032

31-
- name: Setup Yarn
32-
uses: Borales/actions-yarn@3766bb1335b98fb13c60eaf358fe20811b730a88 # v5.0.0
33-
with:
34-
cmd: --version
35-
36-
- name: Locate yarn cache
37-
id: yarncache
38-
run: echo "dir=$(yarn cache dir)" >> "$GITHUB_OUTPUT"
33+
- name: Enable Corepack
34+
run: corepack enable
3935

4036
- name: Cache yarn
4137
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
4238
with:
43-
path: ${{ steps.yarncache.outputs.dir }}
39+
path: .yarn/cache
4440
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
4541
restore-keys: ${{ runner.os }}-yarn-
4642

4743
- name: Install dependencies
48-
run: yarn install --frozen-lockfile
44+
run: yarn install --immutable
4945

5046
- name: Start NatsMQ
5147
uses: step-security/nats-action@2254b4cc4958120e36da3a096e8200dac968be1c # v0.1.4

.github/workflows/api-after-commit.yml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ jobs:
88
buildAndTest:
99
name: Build and Test
1010
runs-on: guardian-linux-medium
11+
env:
12+
YARN_ENABLE_GLOBAL_CACHE: 'false'
1113
services:
1214
cache:
1315
image: registry.redict.io/redict
@@ -17,39 +19,32 @@ jobs:
1719
matrix:
1820
node-version: [ 20.20.2 ]
1921
mongodb-version: [ 7.0.21 ]
20-
ipfs-version: [ 0.41.0 ]
2122
steps:
2223
- name: Harden Runner
2324
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
2425
with:
2526
egress-policy: audit
2627

2728
- name: Checkout Code
28-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
29+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
2930

3031
- name: Use Node.js ${{ matrix.node-version }}
31-
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e #v6.4.0
32+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
3233
with:
3334
node-version: ${{ matrix.node-version }}
3435

35-
- name: Setup Yarn
36-
uses: Borales/actions-yarn@3766bb1335b98fb13c60eaf358fe20811b730a88 # v5.0.0
37-
with:
38-
cmd: --version
39-
40-
- name: Locate yarn cache
41-
id: yarncache
42-
run: echo "dir=$(yarn cache dir)" >> "$GITHUB_OUTPUT"
36+
- name: Enable Corepack
37+
run: corepack enable
4338

4439
- name: Cache yarn
4540
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
4641
with:
47-
path: ${{ steps.yarncache.outputs.dir }}
42+
path: .yarn/cache
4843
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
4944
restore-keys: ${{ runner.os }}-yarn-
5045

5146
- name: Install dependencies
52-
run: yarn install --frozen-lockfile
47+
run: yarn install --immutable
5348

5449
- name: Build packages
5550
run: |
@@ -92,10 +87,10 @@ jobs:
9287
with:
9388
port: '4222'
9489

95-
- name: Set up IPFS ${{ matrix.ipfs-version }}
90+
- name: Set up IPFS
9691
uses: oduwsdl/setup-ipfs@678755ac20f92d2dfca7e16138e40ae75f7a0f6f # v0.8.0
9792
with:
98-
ipfs_version: ${{ matrix.ipfs-version }}
93+
ipfs_version: 0.41.0
9994
run_daemon: true
10095

10196
- name: Start MongoDB
@@ -151,8 +146,8 @@ jobs:
151146
context: ./e2e-tests
152147
tags: cypress-runner
153148
load: true
154-
cache-from: type=gha
155-
cache-to: type=gha,mode=max
149+
cache-from: type=local,src=/tmp/buildkit-cache
150+
cache-to: type=local,dest=/tmp/buildkit-cache,mode=min
156151

157152
- name: Run Cypress Tests in Docker
158153
run: |

.github/workflows/api-manual.yml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616
buildAndTest:
1717
name: Build and Test (Manual)
1818
runs-on: guardian-linux-medium
19+
env:
20+
YARN_ENABLE_GLOBAL_CACHE: 'false'
1921
services:
2022
cache:
2123
image: registry.redict.io/redict
@@ -25,39 +27,32 @@ jobs:
2527
matrix:
2628
node-version: [20.20.2]
2729
mongodb-version: [7.0.21]
28-
ipfs-version: [ 0.41.0 ]
2930
steps:
3031
- name: Harden Runner
3132
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
3233
with:
3334
egress-policy: audit
3435

3536
- name: Checkout Code
36-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
37+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
3738

3839
- name: Use Node.js ${{ matrix.node-version }}
39-
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e #v6.4.0
40+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
4041
with:
4142
node-version: ${{ matrix.node-version }}
4243

43-
- name: Setup Yarn
44-
uses: Borales/actions-yarn@3766bb1335b98fb13c60eaf358fe20811b730a88 # v5.0.0
45-
with:
46-
cmd: --version
47-
48-
- name: Locate yarn cache
49-
id: yarncache
50-
run: echo "dir=$(yarn cache dir)" >> "$GITHUB_OUTPUT"
44+
- name: Enable Corepack
45+
run: corepack enable
5146

5247
- name: Cache yarn
5348
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
5449
with:
55-
path: ${{ steps.yarncache.outputs.dir }}
50+
path: .yarn/cache
5651
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
5752
restore-keys: ${{ runner.os }}-yarn-
5853

5954
- name: Install dependencies
60-
run: yarn install --frozen-lockfile
55+
run: yarn install --immutable
6156

6257
- name: Build packages
6358
run: |
@@ -100,10 +95,10 @@ jobs:
10095
with:
10196
port: "4222"
10297

103-
- name: Set up IPFS ${{ matrix.ipfs-version }}
98+
- name: Set up IPFS
10499
uses: oduwsdl/setup-ipfs@678755ac20f92d2dfca7e16138e40ae75f7a0f6f # v0.8.0
105100
with:
106-
ipfs_version: ${{ matrix.ipfs-version }}
101+
ipfs_version: 0.41.0
107102
run_daemon: true
108103

109104
- name: Start MongoDB
@@ -159,8 +154,8 @@ jobs:
159154
context: ./e2e-tests
160155
tags: cypress-runner
161156
load: true
162-
cache-from: type=gha
163-
cache-to: type=gha,mode=max
157+
cache-from: type=local,src=/tmp/buildkit-cache
158+
cache-to: type=local,dest=/tmp/buildkit-cache,mode=min
164159

165160
- name: Run Cypress API Tests in Docker
166161
run: |

.github/workflows/api-schedule-all.yml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ jobs:
77
buildAndTest:
88
name: Build and Test
99
runs-on: guardian-linux-medium
10+
env:
11+
YARN_ENABLE_GLOBAL_CACHE: 'false'
1012
services:
1113
cache:
1214
image: registry.redict.io/redict
@@ -16,41 +18,34 @@ jobs:
1618
matrix:
1719
node-version: [ 20.20.2 ]
1820
mongodb-version: [ 7.0.21 ]
19-
ipfs-version: [ 0.41.0 ]
2021
steps:
2122
- name: Harden Runner
2223
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
2324
with:
2425
egress-policy: audit
2526

2627
- name: Checkout Code
27-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
28+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
2829
with:
2930
ref: 'develop'
3031

3132
- name: Use Node.js ${{ matrix.node-version }}
32-
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e #v6.4.0
33+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
3334
with:
3435
node-version: ${{ matrix.node-version }}
3536

36-
- name: Setup Yarn
37-
uses: Borales/actions-yarn@3766bb1335b98fb13c60eaf358fe20811b730a88 # v5.0.0
38-
with:
39-
cmd: --version
40-
41-
- name: Locate yarn cache
42-
id: yarncache
43-
run: echo "dir=$(yarn cache dir)" >> "$GITHUB_OUTPUT"
37+
- name: Enable Corepack
38+
run: corepack enable
4439

4540
- name: Cache yarn
4641
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
4742
with:
48-
path: ${{ steps.yarncache.outputs.dir }}
43+
path: .yarn/cache
4944
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
5045
restore-keys: ${{ runner.os }}-yarn-
5146

5247
- name: Install dependencies
53-
run: yarn install --frozen-lockfile
48+
run: yarn install --immutable
5449

5550
- name: Build packages
5651
run: |
@@ -93,10 +88,10 @@ jobs:
9388
with:
9489
port: '4222'
9590

96-
- name: Set up IPFS ${{ matrix.ipfs-version }}
91+
- name: Set up IPFS
9792
uses: oduwsdl/setup-ipfs@678755ac20f92d2dfca7e16138e40ae75f7a0f6f # v0.8.0
9893
with:
99-
ipfs_version: ${{ matrix.ipfs-version }}
94+
ipfs_version: 0.41.0
10095
run_daemon: true
10196

10297
- name: Start MongoDB
@@ -152,8 +147,8 @@ jobs:
152147
context: ./e2e-tests
153148
tags: cypress-runner
154149
load: true
155-
cache-from: type=gha
156-
cache-to: type=gha,mode=max
150+
cache-from: type=local,src=/tmp/buildkit-cache
151+
cache-to: type=local,dest=/tmp/buildkit-cache,mode=min
157152

158153
- name: Run Cypress Tests in Docker
159154
run: |

.github/workflows/api-schedule-vm0033.yml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ jobs:
77
buildAndTest:
88
name: Build and Test
99
runs-on: guardian-linux-medium
10+
env:
11+
YARN_ENABLE_GLOBAL_CACHE: 'false'
1012
services:
1113
cache:
1214
image: registry.redict.io/redict
@@ -16,41 +18,34 @@ jobs:
1618
matrix:
1719
node-version: [ 20.20.2 ]
1820
mongodb-version: [ 7.0.21 ]
19-
ipfs-version: [ 0.41.0 ]
2021
steps:
2122
- name: Harden Runner
2223
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
2324
with:
2425
egress-policy: audit
2526

2627
- name: Checkout Code
27-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
28+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
2829
with:
2930
ref: 'develop'
3031

3132
- name: Use Node.js ${{ matrix.node-version }}
32-
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e #v6.4.0
33+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
3334
with:
3435
node-version: ${{ matrix.node-version }}
3536

36-
- name: Setup Yarn
37-
uses: Borales/actions-yarn@3766bb1335b98fb13c60eaf358fe20811b730a88 # v5.0.0
38-
with:
39-
cmd: --version
40-
41-
- name: Locate yarn cache
42-
id: yarncache
43-
run: echo "dir=$(yarn cache dir)" >> "$GITHUB_OUTPUT"
37+
- name: Enable Corepack
38+
run: corepack enable
4439

4540
- name: Cache yarn
4641
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
4742
with:
48-
path: ${{ steps.yarncache.outputs.dir }}
43+
path: .yarn/cache
4944
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
5045
restore-keys: ${{ runner.os }}-yarn-
5146

5247
- name: Install dependencies
53-
run: yarn install --frozen-lockfile
48+
run: yarn install --immutable
5449

5550
- name: Build packages
5651
run: |
@@ -93,10 +88,10 @@ jobs:
9388
with:
9489
port: '4222'
9590

96-
- name: Set up IPFS ${{ matrix.ipfs-version }}
91+
- name: Set up IPFS
9792
uses: oduwsdl/setup-ipfs@678755ac20f92d2dfca7e16138e40ae75f7a0f6f # v0.8.0
9893
with:
99-
ipfs_version: ${{ matrix.ipfs-version }}
94+
ipfs_version: 0.41.0
10095
run_daemon: true
10196

10297
- name: Start MongoDB
@@ -152,8 +147,8 @@ jobs:
152147
context: ./e2e-tests
153148
tags: cypress-runner
154149
load: true
155-
cache-from: type=gha
156-
cache-to: type=gha,mode=max
150+
cache-from: type=local,src=/tmp/buildkit-cache
151+
cache-to: type=local,dest=/tmp/buildkit-cache,mode=min
157152

158153
- name: Run Cypress Tests in Docker
159154
run: |

0 commit comments

Comments
 (0)