Skip to content

Commit 1610c8b

Browse files
chore: setup action update
1 parent 41c3ac0 commit 1610c8b

File tree

2 files changed

+17
-111
lines changed

2 files changed

+17
-111
lines changed

.github/actions/setup/action.yml

+16-4
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,24 @@ runs:
88
uses: actions/setup-node@v3
99
with:
1010
node-version-file: .nvmrc
11-
cache: 'yarn'
1211

13-
- name: Corepack Enable
12+
- name: Cache dependencies
13+
id: yarn-cache
14+
uses: actions/cache@v3
15+
with:
16+
path: |
17+
**/node_modules
18+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
19+
restore-keys: |
20+
${{ runner.os }}-yarn-
21+
22+
- name: Install yarn
1423
run: corepack enable
1524
shell: bash
1625

1726
- name: Install dependencies
18-
run: yarn install --immutable
19-
shell: bash
27+
if: steps.yarn-cache.outputs.cache-hit != 'true'
28+
run: |
29+
yarn install --cwd example --frozen-lockfile
30+
yarn install --frozen-lockfile
31+
shell: bash

.github/workflows/ci.yml

+1-107
Original file line numberDiff line numberDiff line change
@@ -48,110 +48,4 @@ jobs:
4848
uses: ./.github/actions/setup
4949

5050
- name: Build package
51-
run: yarn prepare
52-
53-
build-android:
54-
runs-on: ubuntu-latest
55-
env:
56-
TURBO_CACHE_DIR: .turbo/android
57-
steps:
58-
- name: Checkout
59-
uses: actions/checkout@v3
60-
61-
- name: Setup
62-
uses: ./.github/actions/setup
63-
64-
- name: Cache turborepo for Android
65-
uses: actions/cache@v3
66-
with:
67-
path: ${{ env.TURBO_CACHE_DIR }}
68-
key: ${{ runner.os }}-turborepo-android-${{ hashFiles('yarn.lock') }}
69-
restore-keys: |
70-
${{ runner.os }}-turborepo-android-
71-
72-
- name: Check turborepo cache for Android
73-
run: |
74-
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:android').cache.status")
75-
76-
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
77-
echo "turbo_cache_hit=1" >> $GITHUB_ENV
78-
fi
79-
80-
- name: Install JDK
81-
if: env.turbo_cache_hit != 1
82-
uses: actions/setup-java@v3
83-
with:
84-
distribution: 'zulu'
85-
java-version: '17'
86-
87-
- name: Finalize Android SDK
88-
if: env.turbo_cache_hit != 1
89-
run: |
90-
/bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"
91-
92-
- name: Cache Gradle
93-
if: env.turbo_cache_hit != 1
94-
uses: actions/cache@v3
95-
with:
96-
path: |
97-
~/.gradle/wrapper
98-
~/.gradle/caches
99-
key: ${{ runner.os }}-gradle-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }}
100-
restore-keys: |
101-
${{ runner.os }}-gradle-
102-
103-
- name: Build example for Android
104-
env:
105-
JAVA_OPTS: "-XX:MaxHeapSize=6g"
106-
run: |
107-
yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}"
108-
109-
build-ios:
110-
runs-on: macos-14
111-
env:
112-
TURBO_CACHE_DIR: .turbo/ios
113-
steps:
114-
- name: Checkout
115-
uses: actions/checkout@v3
116-
117-
- name: Setup
118-
uses: ./.github/actions/setup
119-
120-
- name: Cache turborepo for iOS
121-
uses: actions/cache@v3
122-
with:
123-
path: ${{ env.TURBO_CACHE_DIR }}
124-
key: ${{ runner.os }}-turborepo-ios-${{ hashFiles('yarn.lock') }}
125-
restore-keys: |
126-
${{ runner.os }}-turborepo-ios-
127-
128-
- name: Check turborepo cache for iOS
129-
run: |
130-
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:ios').cache.status")
131-
132-
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
133-
echo "turbo_cache_hit=1" >> $GITHUB_ENV
134-
fi
135-
136-
- name: Cache cocoapods
137-
if: env.turbo_cache_hit != 1
138-
id: cocoapods-cache
139-
uses: actions/cache@v3
140-
with:
141-
path: |
142-
**/ios/Pods
143-
key: ${{ runner.os }}-cocoapods-${{ hashFiles('example/ios/Podfile.lock') }}
144-
restore-keys: |
145-
${{ runner.os }}-cocoapods-
146-
147-
- name: Install cocoapods
148-
if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true'
149-
run: |
150-
cd example/ios
151-
pod install
152-
env:
153-
NO_FLIPPER: 1
154-
155-
- name: Build example for iOS
156-
run: |
157-
yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}"
51+
run: yarn prepare

0 commit comments

Comments
 (0)