update the workflow file #3
This file contains 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
name: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build-android: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "14" | |
- name: Install dependencies | |
run: npm install | |
- name: Set up Java | |
uses: actions/setup-java@v1 | |
with: | |
java-version: "11" | |
- name: Install Android SDK | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 30 | |
script: | | |
npm run android:build | |
- name: Run tests | |
run: npm test | |
build-ios: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "14" | |
- name: Install dependencies | |
run: npm install | |
- name: Install Ruby | |
uses: actions/setup-ruby@v1 | |
with: | |
ruby-version: "2.7" | |
- name: Install Cocoapods | |
run: | | |
sudo gem install cocoapods | |
pod install --project-directory=ios | |
- name: Build iOS | |
run: | | |
xcodebuild -workspace ios/YourProjectName.xcworkspace \ | |
-scheme YourProjectName \ | |
-sdk iphonesimulator \ | |
-configuration Release \ | |
-derivedDataPath build | |
- name: Run tests | |
run: npm test |