-
Notifications
You must be signed in to change notification settings - Fork 16
ci: run Expo build intelligently — scoped bundle check + reserved native build #1029
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kylemcd
wants to merge
2
commits into
main
Choose a base branch
from
kyle-kno-14076-make-the-expo-build-ci-run-intelligently-scope-to-dependency
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+103
−31
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| name: Expo Bundle Check | ||
| on: | ||
| pull_request: | ||
| paths: | ||
| - "packages/types/**" | ||
| - "packages/client/**" | ||
| - "packages/react-core/**" | ||
| - "packages/react-native/**" | ||
| - "packages/expo/**" | ||
| - "examples/expo-example/**" | ||
| - ".github/workflows/expo-bundle.yml" | ||
| - "yarn.lock" | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| bundle: | ||
| name: Metro bundle | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | ||
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | ||
| with: | ||
| node-version: "22.x" | ||
| cache: yarn | ||
| registry-url: "https://registry.npmjs.org" | ||
| scope: "@knocklabs" | ||
| - name: Install dependencies | ||
| run: yarn install --immutable | ||
| - name: Build packages | ||
| run: yarn build:packages | ||
| # Exercises the @knocklabs/* module graph under React Native's Metro | ||
| # resolver (conditional "react-native" exports resolve to source). This | ||
| # is what catches an upstream client/react-core change that breaks how | ||
| # the react-native / expo packages bundle. Fully local: no EXPO_TOKEN, | ||
| # no EAS credits. EXPO_PUBLIC_* vars are optional for bundling. | ||
| - name: Metro bundle expo example | ||
| working-directory: examples/expo-example | ||
| run: yarn expo export --platform android --output-dir "$RUNNER_TEMP/expo-export" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| name: Expo Native Build | ||
| on: | ||
| # Post-merge native signal — catches native-only regressions (Expo SDK / | ||
| # native module bumps) that the per-PR Metro bundle check can't see. | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - "packages/types/**" | ||
| - "packages/client/**" | ||
| - "packages/react-core/**" | ||
| - "packages/react-native/**" | ||
| - "packages/expo/**" | ||
| - "examples/expo-example/**" | ||
| - ".github/workflows/expo-native.yml" | ||
| - "yarn.lock" | ||
| # Opt-in on a risky PR: add the `expo:native-build` label to run the full build. | ||
| pull_request: | ||
| types: [labeled] | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| # Include the label (or event) in the group so an unrelated `labeled` event on | ||
| # the same PR lands in a different group and can't cancel an in-flight opt-in | ||
| # EAS build. Pushes to main still coalesce (they share the `push` discriminator). | ||
| group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.label.name || github.event_name }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| build: | ||
| name: EAS build (Android) | ||
| # On pull_request this only runs for the opt-in label; push/dispatch always run. | ||
| if: >- | ||
| github.event_name != 'pull_request' || | ||
| github.event.label.name == 'expo:native-build' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | ||
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | ||
| with: | ||
| node-version: "22.x" | ||
| cache: yarn | ||
| registry-url: "https://registry.npmjs.org" | ||
| scope: "@knocklabs" | ||
| - name: Install dependencies | ||
| run: yarn install --immutable | ||
| - name: Build packages | ||
| run: yarn build:packages | ||
| - name: Setup Expo and EAS | ||
| uses: expo/expo-github-action@c7b66a9c327a43a8fa7c0158e7f30d6040d2481e # 8.2.1 | ||
| with: | ||
| eas-version: latest | ||
| token: ${{ secrets.EXPO_TOKEN }} | ||
| - name: Build on EAS | ||
| run: cd examples/expo-example && eas build --platform android --profile preview --non-interactive | ||
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.