-
Notifications
You must be signed in to change notification settings - Fork 8
Add GitHub Actions CI for React Native projects #90
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a2372c1
feat: add GitHub Actions CI for React Native projects
48f9f92
Pin Xcode 16.2 for React Native Expo iOS builds
6750f73
Standardize step names to sentence case in pr-checks workflow
331a77b
Update workflow name to Title Case: PR Checks
c18b2aa
Standardize job names to Title Case across all workflows
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
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,123 @@ | ||
| name: React Native CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| paths: | ||
| - 'react-native/**' | ||
| pull_request: | ||
| branches: [ main ] | ||
| paths: | ||
| - 'react-native/**' | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| lint: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| cache: 'yarn' | ||
| cache-dependency-path: react-native/yarn.lock | ||
|
|
||
| - name: Install dependencies | ||
| working-directory: react-native | ||
| run: yarn install --frozen-lockfile | ||
|
|
||
| - name: Run linting | ||
| working-directory: react-native | ||
| run: yarn lint | ||
|
|
||
| build-android: | ||
| runs-on: ubuntu-latest | ||
| needs: lint | ||
| timeout-minutes: 30 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| cache: 'yarn' | ||
| cache-dependency-path: react-native/yarn.lock | ||
|
|
||
| - name: Install dependencies | ||
| working-directory: react-native | ||
| run: yarn install --frozen-lockfile | ||
|
|
||
| - name: Setup Java | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: 'temurin' | ||
| java-version: '17' | ||
|
|
||
| - name: Setup Android SDK | ||
| uses: android-actions/setup-android@v3 | ||
|
|
||
| - name: Cache Gradle dependencies | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| ~/.gradle/caches | ||
| ~/.gradle/wrapper | ||
| react-native/android/.gradle | ||
| key: gradle-${{ runner.os }}-${{ hashFiles('react-native/android/gradle/wrapper/gradle-wrapper.properties', 'react-native/android/**/*.gradle*') }} | ||
| restore-keys: | | ||
| gradle-${{ runner.os }}- | ||
|
|
||
| - name: Build Android | ||
| working-directory: react-native | ||
| run: yarn build:android | ||
|
|
||
| build-ios: | ||
| runs-on: macos-latest | ||
| needs: lint | ||
| timeout-minutes: 30 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| cache: 'yarn' | ||
| cache-dependency-path: react-native/yarn.lock | ||
|
|
||
| - name: Install dependencies | ||
| working-directory: react-native | ||
| run: yarn install --frozen-lockfile | ||
|
|
||
| - name: Cache CocoaPods dependencies | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| react-native/ios/Pods | ||
| ~/Library/Caches/CocoaPods | ||
| ~/.cocoapods | ||
| key: cocoapods-${{ runner.os }}-${{ hashFiles('react-native/ios/Podfile.lock') }} | ||
| restore-keys: | | ||
| cocoapods-${{ runner.os }}- | ||
|
|
||
| - name: Install Ruby gems | ||
| working-directory: react-native | ||
| run: bundle install | ||
|
|
||
| - name: Install CocoaPods | ||
| working-directory: react-native/ios | ||
| run: bundle exec pod install --repo-update | ||
|
|
||
| - name: Build iOS | ||
| working-directory: react-native | ||
| run: yarn build:ios | ||
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,132 @@ | ||
| name: React Native Expo CI | ||
|
teodorciuraru marked this conversation as resolved.
|
||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| paths: | ||
| - 'react-native-expo/**' | ||
| pull_request: | ||
| branches: [ main ] | ||
| paths: | ||
| - 'react-native-expo/**' | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| lint: | ||
| name: Lint | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| cache: 'yarn' | ||
| cache-dependency-path: react-native-expo/yarn.lock | ||
|
|
||
| - name: Install dependencies | ||
| working-directory: react-native-expo | ||
| run: yarn install | ||
|
|
||
| - name: Run linting | ||
| working-directory: react-native-expo | ||
| run: yarn lint | ||
|
|
||
| build-android: | ||
| name: Build Android | ||
| runs-on: ubuntu-latest | ||
| needs: lint | ||
| timeout-minutes: 30 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| cache: 'yarn' | ||
| cache-dependency-path: react-native-expo/yarn.lock | ||
|
|
||
| - name: Install dependencies | ||
| working-directory: react-native-expo | ||
| run: yarn install | ||
|
|
||
| - name: Setup Java | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: 'temurin' | ||
| java-version: '17' | ||
|
|
||
| - name: Setup Android SDK | ||
| uses: android-actions/setup-android@v3 | ||
|
|
||
| - name: Cache Gradle dependencies | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| ~/.gradle/caches | ||
| ~/.gradle/wrapper | ||
| react-native-expo/android/.gradle | ||
| key: gradle-expo-${{ runner.os }}-${{ hashFiles('react-native-expo/android/gradle/wrapper/gradle-wrapper.properties', 'react-native-expo/android/**/*.gradle*') }} | ||
| restore-keys: | | ||
| gradle-expo-${{ runner.os }}- | ||
|
|
||
| - name: Prebuild Android project | ||
| working-directory: react-native-expo | ||
| run: npx expo prebuild --platform android | ||
|
|
||
| - name: Build Android | ||
| working-directory: react-native-expo | ||
| run: yarn build:android | ||
|
|
||
| build-ios: | ||
| name: Build iOS | ||
| runs-on: macos-latest | ||
| needs: lint | ||
| timeout-minutes: 30 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| cache: 'yarn' | ||
| cache-dependency-path: react-native-expo/yarn.lock | ||
|
|
||
| - name: Install dependencies | ||
| working-directory: react-native-expo | ||
| run: yarn install | ||
|
|
||
| - name: Cache CocoaPods dependencies | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| ~/Library/Caches/CocoaPods | ||
| ~/.cocoapods | ||
|
teodorciuraru marked this conversation as resolved.
|
||
| key: cocoapods-expo-${{ runner.os }}-${{ hashFiles('react-native-expo/ios/Podfile.lock') }} | ||
| restore-keys: | | ||
| cocoapods-expo-${{ runner.os }}- | ||
|
|
||
| - name: Prebuild iOS project | ||
| working-directory: react-native-expo | ||
| run: npx expo prebuild --platform ios | ||
|
|
||
| - name: Set Xcode version | ||
| run: sudo xcode-select -s /Applications/Xcode_16.2.app | ||
|
|
||
| - name: Install CocoaPods | ||
| working-directory: react-native-expo/ios | ||
| run: pod install --repo-update | ||
|
|
||
| - name: Build iOS | ||
| working-directory: react-native-expo | ||
| run: yarn build:ios | ||
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 |
|---|---|---|
|
|
@@ -10,6 +10,7 @@ web-build/ | |
| expo-env.d.ts | ||
| android | ||
| ios | ||
| !ios/Podfile.lock | ||
|
|
||
| # Native | ||
| *.orig.* | ||
|
|
||
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.