Skip to content

Commit e2039b3

Browse files
authored
chore(cli): swap yarn to bun on CI (#904)
* chore(cli): swap yarn to bun in lint actions * chore(cli): swap yarn to bun in android actions * chore(cli): swap yarn to bun in iOS actions
1 parent 650be82 commit e2039b3

File tree

5 files changed

+37
-57
lines changed

5 files changed

+37
-57
lines changed

.github/actions/install-dependencies/action.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ runs:
66
steps:
77
- name: Install dependencies
88
shell: bash
9-
run: yarn install --frozen-lockfile
9+
run: bun install
1010

1111
- name: Cache
1212
uses: actions/cache@v3
@@ -21,10 +21,10 @@ runs:
2121
cache-name: cached-example-npm-deps
2222
with:
2323
path: example/node_modules
24-
key: ${{ hashFiles('./example/yarn.lock') }}-${{ hashFiles('./yarn.lock') }}
24+
key: ${{ hashFiles('./example/bun.lockb') }}-${{ hashFiles('./bun.lockb') }}
2525

26-
- name: Install required example dependencies on yarn.lock change
26+
- name: Install required example dependencies on bun.lockb change
2727
if: steps.cache-example-npm.outputs.cache-hit != 'true'
2828
shell: bash
29-
run: yarn install --frozen-lockfile
30-
working-directory: example
29+
run: bun install
30+
working-directory: example

.github/workflows/android.yml

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,11 @@ jobs:
1919
group: ${{ github.ref }}-android
2020
cancel-in-progress: true
2121
steps:
22+
- uses: oven-sh/setup-bun@v2
2223
- uses: actions/checkout@v4
23-
- uses: ./.github/actions/install-dependencies
2424

25-
- name: Pull dependencies
26-
uses: actions/cache@v4
27-
with:
28-
path: ./node_modules
29-
key: ${{ hashFiles('./package.json') }}
30-
31-
- name: Cache example node modules
32-
id: cache-example-npm
33-
uses: actions/cache@v4
34-
env:
35-
cache-name: cached-example-npm-deps
36-
with:
37-
path: example/node_modules
38-
key: ${{ hashFiles('./example/yarn.lock') }}-${{ hashFiles('./yarn.lock') }}
39-
40-
- name: Install required example dependencies on yarn.lock change
41-
if: steps.cache-example-npm.outputs.cache-hit != 'true'
42-
run: yarn bootstrap-no-pods --frozen-lockfile
25+
- name: Install dependencies
26+
uses: ./.github/actions/install-dependencies
4327

4428
- uses: actions/setup-java@v4
4529
with:
@@ -48,11 +32,18 @@ jobs:
4832
cache: 'gradle'
4933

5034
- name: Install Maestro CLI
51-
run: export MAESTRO_VERSION=1.31.0; curl -Ls "https://get.maestro.mobile.dev" | bash
35+
run: |
36+
export MAESTRO_VERSION=1.39.1; curl -Ls "https://get.maestro.mobile.dev" | bash
37+
brew tap facebook/fb
38+
brew install facebook/fb/idb-companion
5239
5340
- name: Add Maestro to path
5441
run: echo "${HOME}/.maestro/bin" >> $GITHUB_PATH
5542

43+
- name: Bundle app
44+
run: bun run build:android
45+
working-directory: example
46+
5647
- name: Run Android Emulator and app
5748
uses: reactivecircus/android-emulator-runner@v2
5849
with:
@@ -65,8 +56,8 @@ jobs:
6556
avd-name: e2e_emulator
6657
arch: x86_64
6758
script: |
68-
yarn run-example-android
69-
yarn test:e2e:android
59+
bun run-example-android
60+
bun test:e2e:android
7061
7162
- name: Upload report
7263
if: always()

.github/workflows/ios.yml

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,11 @@ jobs:
2020
group: ${{ github.ref }}-ios
2121
cancel-in-progress: true
2222
steps:
23+
- uses: oven-sh/setup-bun@v2
2324
- uses: actions/checkout@v4
24-
- uses: ./.github/actions/install-dependencies
2525

26-
- name: Pull dependencies
27-
uses: actions/cache@v4
28-
with:
29-
path: ./node_modules
30-
key: ${{ hashFiles('./package.json') }}
31-
32-
- name: Cache example node modules
33-
id: cache-example-npm
34-
uses: actions/cache@v4
35-
env:
36-
cache-name: cached-example-npm-deps
37-
with:
38-
path: example/node_modules
39-
key: ${{ hashFiles('./example/yarn.lock') }}-${{ hashFiles('./yarn.lock') }}
40-
41-
- name: Install required example dependencies on yarn.lock change
42-
if: steps.cache-example-npm.outputs.cache-hit != 'true'
43-
run: yarn install --frozen-lockfile
44-
working-directory: example
26+
- name: Install dependencies
27+
uses: ./.github/actions/install-dependencies
4528

4629
- name: Cache Pods
4730
id: cache-pods
@@ -53,16 +36,16 @@ jobs:
5336
key: ${{ hashFiles('./example/ios/Podfile.lock') }}
5437

5538
- name: Bundle app
56-
run: yarn build:ios
57-
working-directory: example/ios
39+
run: bun run build:ios
40+
working-directory: example
5841

5942
- name: Install example Pods
6043
run: pod install
6144
working-directory: example/ios
6245

6346
- name: Install Maestro CLI
6447
run: |
65-
curl -Ls "https://get.maestro.mobile.dev" | bash
48+
export MAESTRO_VERSION=1.39.1; curl -Ls "https://get.maestro.mobile.dev" | bash
6649
brew tap facebook/fb
6750
brew install facebook/fb/idb-companion
6851
@@ -71,8 +54,8 @@ jobs:
7154

7255
- name: Build iOS App
7356
run: |
74-
yarn run-example-ios
57+
bun run-example-ios
7558
7659
- name: Run tests
7760
run: |
78-
yarn test:e2e:ios
61+
bun test:e2e:ios

.github/workflows/main.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ jobs:
1919
name: Install dependencies
2020
runs-on: ubuntu-latest
2121
steps:
22+
- uses: oven-sh/setup-bun@v2
23+
2224
- name: Checkout repository
2325
uses: actions/checkout@v4
26+
2427
- name: Install dependencies
2528
uses: ./.github/actions/install-dependencies
2629

@@ -29,6 +32,9 @@ jobs:
2932
runs-on: ubuntu-latest
3033
needs: install-dependencies
3134
steps:
35+
- name: Set up Bun
36+
uses: oven-sh/setup-bun@v2
37+
3238
- name: Checkout repository
3339
uses: actions/checkout@v4
3440

@@ -45,13 +51,13 @@ jobs:
4551
cache-name: cached-example-npm-deps
4652
with:
4753
path: example/node_modules
48-
key: ${{ hashFiles('./example/yarn.lock') }}-${{ hashFiles('./yarn.lock') }}
54+
key: ${{ hashFiles('./example/bun.lockb') }}-${{ hashFiles('./bun.lockb') }}
4955

5056
- name: Lint files
51-
run: yarn lint
57+
run: bun run lint
5258

5359
- name: Typecheck files
54-
run: yarn typescript
60+
run: bun run typescript
5561

5662
- name: Build package
57-
run: yarn prepare
63+
run: bun run prepare

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"bootstrap": "yarn example && yarn && yarn example pods",
3333
"bootstrap-no-pods": "yarn example && yarn",
3434
"test:e2e:android": "bash ./scripts/run-maestro-tests.sh android",
35-
"run-example-android": "cd example;yarn build:android;react-native run-android --mode \"Release\" --appId com.pagerviewexample",
35+
"run-example-android": "cd example;react-native run-android --mode \"Release\" --appId com.pagerviewexample",
3636
"run-example-ios": "cd example;react-native run-ios --mode \"Release\" --simulator \"iPhone 13 (15.2)\"",
3737
"test:e2e:ios": "bash ./scripts/run-maestro-tests.sh ios"
3838
},

0 commit comments

Comments
 (0)