Skip to content

Commit aefbd8e

Browse files
committed
ci: adopt yarn 4 caching and consolidated installs
Update GitHub Actions workflows for the Yarn 4 + workspaces world: - check-pr.yml, release.yml, sample-distribution.yml: add `cache: 'yarn'` + `cache-dependency-path: 'yarn.lock'` to every actions/setup-node@v6 invocation so the workflows hit the .yarn/cache between runs. sdk-size-metrics.yml already had this. - check-pr.yml, release.yml: replace `yarn lerna-workspaces run lint` with the plain `yarn lint` script (which forwards to the SDK workspace) -- lerna is gone. - check-pr.yml: replace `cd package && yarn test:typecheck` with `yarn workspace stream-chat-react-native-core test:typecheck` for consistency with the rest of the workflow. - changelog-preview.yml: collapse the four sequential `yarn --frozen-lockfile` / `yarn` invocations (root, package/, native-package/, examples/SampleApp/) into a single `yarn install --immutable` at the workspace root. Move the setup-node step after checkout (where it belongs) and drop the pre-checkout duplicate. - sample-distribution.yml: reorder checkout to run before setup-node so the cache step can find yarn.lock.
1 parent b374931 commit aefbd8e

4 files changed

Lines changed: 19 additions & 20 deletions

File tree

.github/workflows/changelog-preview.yml

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@ jobs:
1313
matrix:
1414
node-version: [ 24.x ]
1515
steps:
16-
- name: Use Node.js ${{ matrix.node-version }}
17-
uses: actions/setup-node@v6
18-
with:
19-
node-version: ${{ matrix.node-version }}
20-
- name: Install Linux build tools
21-
run: sudo apt-get update && sudo apt-get install -y build-essential
2216
- uses: actions/checkout@v6
2317
with:
2418
ref: develop
@@ -31,15 +25,12 @@ jobs:
3125
with:
3226
node-version: ${{ matrix.node-version }}
3327
registry-url: 'https://registry.npmjs.org'
28+
cache: 'yarn'
29+
cache-dependency-path: 'yarn.lock'
30+
- name: Install Linux build tools
31+
run: sudo apt-get update && sudo apt-get install -y build-essential
3432
- name: Installation
35-
run: |
36-
yarn --frozen-lockfile
37-
cd package/
38-
yarn --frozen-lockfile
39-
cd native-package/
40-
yarn
41-
cd ../../examples/SampleApp/
42-
yarn
33+
run: yarn install --immutable
4334

4435
- name: Generate Changelog
4536
id: generate_changelog
@@ -54,7 +45,7 @@ jobs:
5445
5546
echo "Changelog file ready! Setting up outputs"
5647
CHANGELOG_PREVIEW=$(cat NEXT_RELEASE_CHANGELOG.md)
57-
48+
5849
CHANGELOG_PREVIEW_ESCAPED="${CHANGELOG_PREVIEW//'%'/'%25'}"
5950
CHANGELOG_PREVIEW_ESCAPED="${CHANGELOG_PREVIEW_ESCAPED//$'\n'/'%0A'}"
6051
CHANGELOG_PREVIEW_ESCAPED="${CHANGELOG_PREVIEW_ESCAPED//$'\r'/'%0D'}"

.github/workflows/check-pr.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,15 @@ jobs:
2323
uses: actions/setup-node@v6
2424
with:
2525
node-version: ${{ matrix.node-version }}
26+
cache: 'yarn'
27+
cache-dependency-path: 'yarn.lock'
2628
- name: Install Linux build tools
2729
run: sudo apt-get update && sudo apt-get install -y build-essential
2830
- name: Install && Build - SDK and Sample App
2931
uses: ./.github/actions/install-and-build-sdk
3032
- name: Lint
31-
run: yarn lerna-workspaces run lint
33+
run: yarn lint
3234
- name: Typecheck tests
33-
run: cd package && yarn test:typecheck
35+
run: yarn workspace stream-chat-react-native-core test:typecheck
3436
- name: Test
3537
run: yarn test:coverage

.github/workflows/release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ jobs:
3131
with:
3232
node-version: ${{ matrix.node-version }}
3333
registry-url: 'https://registry.npmjs.org'
34+
cache: 'yarn'
35+
cache-dependency-path: 'yarn.lock'
3436
- name: Install Linux build tools
3537
run: sudo apt-get update && sudo apt-get install -y build-essential
3638

@@ -43,7 +45,7 @@ jobs:
4345
uses: ./.github/actions/install-and-build-sdk
4446

4547
- name: Lint
46-
run: yarn lerna-workspaces run lint
48+
run: yarn lint
4749

4850
- name: Test
4951
if: github.ref == 'refs/heads/develop'

.github/workflows/sample-distribution.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@ jobs:
2323
uses: webfactory/ssh-agent@v0.10.0
2424
with:
2525
ssh-private-key: ${{ secrets.BOT_SSH_PRIVATE_KEY }}
26+
- uses: actions/checkout@v6
2627
- name: Use Node.js ${{ matrix.node-version }}
2728
uses: actions/setup-node@v6
2829
with:
2930
node-version: ${{ matrix.node-version }}
30-
- uses: actions/checkout@v6
31+
cache: 'yarn'
32+
cache-dependency-path: 'yarn.lock'
3133
- uses: maxim-lobanov/setup-xcode@v1
3234
with:
3335
xcode-version: '26.2' # Update as needed
@@ -64,11 +66,13 @@ jobs:
6466
matrix:
6567
node-version: [24.x]
6668
steps:
69+
- uses: actions/checkout@v6
6770
- name: Use Node.js ${{ matrix.node-version }}
6871
uses: actions/setup-node@v6
6972
with:
7073
node-version: ${{ matrix.node-version }}
71-
- uses: actions/checkout@v6
74+
cache: 'yarn'
75+
cache-dependency-path: 'yarn.lock'
7276
- name: Install Linux build tools
7377
run: sudo apt-get update && sudo apt-get install -y build-essential
7478
- uses: actions/setup-java@v5

0 commit comments

Comments
 (0)