Skip to content

Commit eb30bf7

Browse files
authored
chore(🐙): use manual workflow trigger for android, ios, macos builds (#286)
1 parent 6bbed57 commit eb30bf7

1 file changed

Lines changed: 58 additions & 50 deletions

File tree

.github/workflows/ci.yml

Lines changed: 58 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ on:
2323
description: 'Build for macOS'
2424
type: boolean
2525
default: false
26+
run_reference_tests:
27+
description: 'Run reference tests'
28+
type: boolean
29+
default: false
2630

2731
concurrency:
2832
group: ${{ github.ref }}
@@ -65,27 +69,27 @@ jobs:
6569
path: packages/webgpu/package.tgz
6670
compression-level: 0
6771

68-
# These are disabled since they are not useful in the context of
69-
# GitHub Actions CI and they slow down the workflow significantly.
70-
# test:
71-
# runs-on: macos-latest
72-
# steps:
73-
# - name: Checkout
74-
# uses: actions/checkout@v4
72+
reference-tests:
73+
if: github.event_name == 'workflow_dispatch' && github.event.inputs.run_reference_tests == 'true'
74+
runs-on: macos-latest
75+
steps:
76+
- name: Checkout
77+
uses: actions/checkout@v4
7578

76-
# - name: Setup
77-
# uses: ./.github/actions/setup
78-
# with:
79-
# github_token: ${{ secrets.GITHUB_TOKEN }}
79+
- name: Setup
80+
uses: ./.github/actions/setup
81+
with:
82+
github_token: ${{ secrets.GITHUB_TOKEN }}
8083

81-
# - name: Install Chrome
82-
# run: npx puppeteer browsers install chrome
84+
- name: Install Chrome
85+
run: npx puppeteer browsers install chrome
8386

84-
# - name: Run reference test suite
85-
# working-directory: packages/webgpu
86-
# run: yarn test:ref
87+
- name: Run reference test suite
88+
working-directory: packages/webgpu
89+
run: yarn test:ref
8790

8891
build-android:
92+
if: github.event_name == 'workflow_dispatch' && github.event.inputs.build_android == 'true'
8993
runs-on: macos-latest
9094
env:
9195
TURBO_CACHE_DIR: .turbo/android
@@ -126,7 +130,7 @@ jobs:
126130
id: setup-ndk
127131
with:
128132
ndk-version: r27d
129-
133+
130134
- name: Set ANDROID_NDK
131135
run: echo "ANDROID_NDK=$ANDROID_HOME/ndk-bundle" >> $GITHUB_ENV
132136

@@ -156,6 +160,7 @@ jobs:
156160
yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --force
157161
158162
build-ios:
163+
if: github.event_name == 'workflow_dispatch' && github.event.inputs.build_ios == 'true'
159164
runs-on: macos-latest
160165
env:
161166
TURBO_CACHE_DIR: .turbo/ios
@@ -187,36 +192,39 @@ jobs:
187192
- name: Build example for iOS
188193
run: |
189194
yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}"
190-
# We disable it until RNTA support 0.81
191-
# build-macos:
192-
# runs-on: macos-latest
193-
# env:
194-
# TURBO_CACHE_DIR: .turbo/macos
195-
# steps:
196-
# - name: Checkout
197-
# uses: actions/checkout@v3
198-
199-
# - name: Setup
200-
# uses: ./.github/actions/setup
201-
# with:
202-
# github_token: ${{ secrets.GITHUB_TOKEN }}
203-
204-
# - name: Cache turborepo for macOS
205-
# uses: actions/cache@v3
206-
# with:
207-
# path: ${{ env.TURBO_CACHE_DIR }}
208-
# key: ${{ runner.os }}-turborepo-macos-${{ hashFiles('yarn.lock') }}
209-
# restore-keys: |
210-
# ${{ runner.os }}-turborepo-macos-
211-
212-
# - name: Check turborepo cache for macOS
213-
# run: |
214-
# 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")
215-
216-
# if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
217-
# echo "turbo_cache_hit=1" >> $GITHUB_ENV
218-
# fi
219-
220-
# - name: Build example for macOS
221-
# run: |
222-
# 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

Comments
 (0)