example app adjustment #101
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
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - next | |
| pull_request: | |
| branches: | |
| - main | |
| - next | |
| merge_group: | |
| types: | |
| - checks_requested | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| - name: Lint files | |
| run: npm run lint -- --max-warnings=0 | |
| typecheck: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| - name: Typecheck library | |
| run: npm run typecheck | |
| - name: Install example dependencies | |
| run: npm install --no-audit --no-fund | |
| working-directory: example | |
| - name: Typecheck example | |
| run: npx tsc --noEmit | |
| working-directory: example | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| - name: Run unit tests | |
| run: npx jest --maxWorkers=2 --coverage --coverageThreshold='{"global":{"lines":80,"functions":80,"branches":70,"statements":80}}' | |
| build-library: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - lint | |
| - typecheck | |
| - test | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| - name: Build package | |
| run: npm run build | |
| build-android: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build-library | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| - name: Install JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: "temurin" | |
| java-version: "17" | |
| - name: Finalize Android SDK | |
| run: | | |
| /bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null" | |
| - name: Cache Gradle | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/wrapper | |
| ~/.gradle/caches | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Install example dependencies | |
| run: npm install --no-audit --no-fund | |
| working-directory: example | |
| - name: Make Gradlew executable | |
| run: chmod +x example/android/gradlew | |
| - name: Build example for Android | |
| env: | |
| JAVA_OPTS: "-XX:MaxHeapSize=6g" | |
| run: cd example/android && ./gradlew assembleDebug --no-daemon | |
| build-ios: | |
| runs-on: macos-26 | |
| needs: | |
| - build-library | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| - name: Cache cocoapods | |
| id: cocoapods-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| **/ios/Pods | |
| key: ${{ runner.os }}-cocoapods-${{ hashFiles('example/ios/Podfile.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cocoapods- | |
| - name: Install example dependencies | |
| run: npm install --no-audit --no-fund | |
| working-directory: example | |
| - name: Install cocoapods | |
| run: | | |
| cd example/ios | |
| pod install | |
| env: | |
| NO_FLIPPER: 1 | |
| - name: Build example for iOS | |
| run: | | |
| cd example/ios | |
| xcodebuild build \ | |
| -workspace HapticFeedbackExample.xcworkspace \ | |
| -scheme HapticFeedbackExample \ | |
| -sdk iphonesimulator \ | |
| -configuration Debug \ | |
| -destination 'platform=iOS Simulator,name=iPhone 17' \ | |
| CODE_SIGNING_ALLOWED=NO |