diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0bbe3c780..5ee9f26f9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,6 +23,10 @@ on: description: 'Build for macOS' type: boolean default: false + run_reference_tests: + description: 'Run reference tests' + type: boolean + default: false concurrency: group: ${{ github.ref }} @@ -65,27 +69,27 @@ jobs: path: packages/webgpu/package.tgz compression-level: 0 - # These are disabled since they are not useful in the context of - # GitHub Actions CI and they slow down the workflow significantly. - # test: - # runs-on: macos-latest - # steps: - # - name: Checkout - # uses: actions/checkout@v4 + reference-tests: + if: github.event_name == 'workflow_dispatch' && github.event.inputs.run_reference_tests == 'true' + runs-on: macos-latest + steps: + - name: Checkout + uses: actions/checkout@v4 - # - name: Setup - # uses: ./.github/actions/setup - # with: - # github_token: ${{ secrets.GITHUB_TOKEN }} + - name: Setup + uses: ./.github/actions/setup + with: + github_token: ${{ secrets.GITHUB_TOKEN }} - # - name: Install Chrome - # run: npx puppeteer browsers install chrome + - name: Install Chrome + run: npx puppeteer browsers install chrome - # - name: Run reference test suite - # working-directory: packages/webgpu - # run: yarn test:ref + - name: Run reference test suite + working-directory: packages/webgpu + run: yarn test:ref build-android: + if: github.event_name == 'workflow_dispatch' && github.event.inputs.build_android == 'true' runs-on: macos-latest env: TURBO_CACHE_DIR: .turbo/android @@ -126,7 +130,7 @@ jobs: id: setup-ndk with: ndk-version: r27d - + - name: Set ANDROID_NDK run: echo "ANDROID_NDK=$ANDROID_HOME/ndk-bundle" >> $GITHUB_ENV @@ -156,6 +160,7 @@ jobs: yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --force build-ios: + if: github.event_name == 'workflow_dispatch' && github.event.inputs.build_ios == 'true' runs-on: macos-latest env: TURBO_CACHE_DIR: .turbo/ios @@ -187,36 +192,39 @@ jobs: - name: Build example for iOS run: | yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" -# We disable it until RNTA support 0.81 -# build-macos: -# runs-on: macos-latest -# env: -# TURBO_CACHE_DIR: .turbo/macos -# steps: -# - name: Checkout -# uses: actions/checkout@v3 - -# - name: Setup -# uses: ./.github/actions/setup -# with: -# github_token: ${{ secrets.GITHUB_TOKEN }} - -# - name: Cache turborepo for macOS -# uses: actions/cache@v3 -# with: -# path: ${{ env.TURBO_CACHE_DIR }} -# key: ${{ runner.os }}-turborepo-macos-${{ hashFiles('yarn.lock') }} -# restore-keys: | -# ${{ runner.os }}-turborepo-macos- - -# - name: Check turborepo cache for macOS -# run: | -# 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") - -# if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then -# echo "turbo_cache_hit=1" >> $GITHUB_ENV -# fi - -# - name: Build example for macOS -# run: | -# yarn turbo run build:macos --cache-dir="${{ env.TURBO_CACHE_DIR }}" + + # Note: This job is disabled by default until RNTA supports 0.81 + # Enable it manually via workflow_dispatch when needed + build-macos: + if: github.event_name == 'workflow_dispatch' && github.event.inputs.build_macos == 'true' + runs-on: macos-latest + env: + TURBO_CACHE_DIR: .turbo/macos + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup + uses: ./.github/actions/setup + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Cache turborepo for macOS + uses: actions/cache@v4 + with: + path: ${{ env.TURBO_CACHE_DIR }} + key: ${{ runner.os }}-turborepo-macos-${{ hashFiles('yarn.lock') }} + restore-keys: | + ${{ runner.os }}-turborepo-macos- + + - name: Check turborepo cache for macOS + run: | + 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") + + if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then + echo "turbo_cache_hit=1" >> $GITHUB_ENV + fi + + - name: Build example for macOS + run: | + yarn turbo run build:macos --cache-dir="${{ env.TURBO_CACHE_DIR }}"