99 merge_group :
1010 types :
1111 - checks_requested
12+ workflow_dispatch :
13+ inputs :
14+ build_android :
15+ description : ' Build for Android'
16+ type : boolean
17+ default : false
18+ build_ios :
19+ description : ' Build for iOS'
20+ type : boolean
21+ default : false
22+ build_macos :
23+ description : ' Build for macOS'
24+ type : boolean
25+ default : false
26+ run_reference_tests :
27+ description : ' Run reference tests'
28+ type : boolean
29+ default : false
1230
1331concurrency :
1432 group : ${{ github.ref }}
1533 cancel-in-progress : true
1634
1735jobs :
18- static-analysis :
36+ build :
1937 runs-on : ubuntu-latest
2038 steps :
2139 - name : Checkout
22- uses : actions/checkout@v3
40+ uses : actions/checkout@v4
2341
2442 - name : Setup
2543 uses : ./.github/actions/setup
@@ -36,11 +54,27 @@ jobs:
3654 - name : Typecheck files
3755 run : yarn tsc
3856
39- test :
57+ - name : Build
58+ working-directory : packages/webgpu
59+ run : yarn build
60+
61+ - name : Package
62+ working-directory : packages/webgpu
63+ run : yarn pack
64+
65+ - name : Upload package artifact
66+ uses : actions/upload-artifact@v4
67+ with :
68+ name : package
69+ path : packages/webgpu/package.tgz
70+ compression-level : 0
71+
72+ reference-tests :
73+ if : github.event_name == 'workflow_dispatch' && github.event.inputs.run_reference_tests == 'true'
4074 runs-on : macos-latest
4175 steps :
4276 - name : Checkout
43- uses : actions/checkout@v3
77+ uses : actions/checkout@v4
4478
4579 - name : Setup
4680 uses : ./.github/actions/setup
@@ -54,24 +88,22 @@ jobs:
5488 working-directory : packages/webgpu
5589 run : yarn test:ref
5690
57- - name : Build package
58- run : yarn build
59-
6091 build-android :
92+ if : github.event_name == 'workflow_dispatch' && github.event.inputs.build_android == 'true'
6193 runs-on : macos-latest
6294 env :
6395 TURBO_CACHE_DIR : .turbo/android
6496 steps :
6597 - name : Checkout
66- uses : actions/checkout@v3
98+ uses : actions/checkout@v4
6799
68100 - name : Setup
69101 uses : ./.github/actions/setup
70102 with :
71103 github_token : ${{ secrets.GITHUB_TOKEN }}
72104
73105 - name : Cache turborepo for Android
74- uses : actions/cache@v3
106+ uses : actions/cache@v4
75107 with :
76108 path : ${{ env.TURBO_CACHE_DIR }}
77109 key : ${{ runner.os }}-turborepo-android-${{ hashFiles('yarn.lock') }}
98130 id : setup-ndk
99131 with :
100132 ndk-version : r27d
101-
133+
102134 - name : Set ANDROID_NDK
103135 run : echo "ANDROID_NDK=$ANDROID_HOME/ndk-bundle" >> $GITHUB_ENV
104136
@@ -112,7 +144,7 @@ jobs:
112144
113145 - name : Cache Gradle
114146 if : env.turbo_cache_hit != 1
115- uses : actions/cache@v3
147+ uses : actions/cache@v4
116148 with :
117149 path : |
118150 ~/.gradle/wrapper
@@ -128,20 +160,21 @@ jobs:
128160 yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --force
129161
130162 build-ios :
163+ if : github.event_name == 'workflow_dispatch' && github.event.inputs.build_ios == 'true'
131164 runs-on : macos-latest
132165 env :
133166 TURBO_CACHE_DIR : .turbo/ios
134167 steps :
135168 - name : Checkout
136- uses : actions/checkout@v3
169+ uses : actions/checkout@v4
137170
138171 - name : Setup
139172 uses : ./.github/actions/setup
140173 with :
141174 github_token : ${{ secrets.GITHUB_TOKEN }}
142175
143176 - name : Cache turborepo for iOS
144- uses : actions/cache@v3
177+ uses : actions/cache@v4
145178 with :
146179 path : ${{ env.TURBO_CACHE_DIR }}
147180 key : ${{ runner.os }}-turborepo-ios-${{ hashFiles('yarn.lock') }}
@@ -159,36 +192,39 @@ jobs:
159192 - name : Build example for iOS
160193 run : |
161194 yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}"
162- # We disable it until RNTA support 0.81
163- # build-macos:
164- # runs-on: macos-latest
165- # env:
166- # TURBO_CACHE_DIR: .turbo/macos
167- # steps:
168- # - name: Checkout
169- # uses: actions/checkout@v3
170-
171- # - name: Setup
172- # uses: ./.github/actions/setup
173- # with:
174- # github_token: ${{ secrets.GITHUB_TOKEN }}
175-
176- # - name: Cache turborepo for macOS
177- # uses: actions/cache@v3
178- # with:
179- # path: ${{ env.TURBO_CACHE_DIR }}
180- # key: ${{ runner.os }}-turborepo-macos-${{ hashFiles('yarn.lock') }}
181- # restore-keys: |
182- # ${{ runner.os }}-turborepo-macos-
183-
184- # - name: Check turborepo cache for macOS
185- # run: |
186- # TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:macos --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:macos').cache.status")
187-
188- # if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
189- # echo "turbo_cache_hit=1" >> $GITHUB_ENV
190- # fi
191-
192- # - name: Build example for macOS
193- # run: |
194- # yarn turbo run build:macos --cache-dir="${{ env.TURBO_CACHE_DIR }}"
195+
196+ # Note: This job is disabled by default until RNTA supports 0.81
197+ # Enable it manually via workflow_dispatch when needed
198+ build-macos :
199+ if : github.event_name == 'workflow_dispatch' && github.event.inputs.build_macos == 'true'
200+ runs-on : macos-latest
201+ env :
202+ TURBO_CACHE_DIR : .turbo/macos
203+ steps :
204+ - name : Checkout
205+ uses : actions/checkout@v4
206+
207+ - name : Setup
208+ uses : ./.github/actions/setup
209+ with :
210+ github_token : ${{ secrets.GITHUB_TOKEN }}
211+
212+ - name : Cache turborepo for macOS
213+ uses : actions/cache@v4
214+ with :
215+ path : ${{ env.TURBO_CACHE_DIR }}
216+ key : ${{ runner.os }}-turborepo-macos-${{ hashFiles('yarn.lock') }}
217+ restore-keys : |
218+ ${{ runner.os }}-turborepo-macos-
219+
220+ - name : Check turborepo cache for macOS
221+ run : |
222+ TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:macos --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:macos').cache.status")
223+
224+ if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
225+ echo "turbo_cache_hit=1" >> $GITHUB_ENV
226+ fi
227+
228+ - name : Build example for macOS
229+ run : |
230+ yarn turbo run build:macos --cache-dir="${{ env.TURBO_CACHE_DIR }}"
0 commit comments