Prepare v13 package for release #165
Workflow file for this run
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: Test and Coverage Check | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| on: | |
| pull_request: | |
| branches: | |
| - "master" | |
| - "develop-v13" | |
| # Allows you to run this workflow manually from the Actions tab. | |
| workflow_dispatch: | |
| jobs: | |
| install-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Use Node.js 22 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: "npm" | |
| - name: Install Node modules | |
| run: npm ci | |
| env: | |
| NPM_CONFIG_REGISTRY: https://registry.npmjs.org/ | |
| - name: Linting | |
| run: npm run lint | |
| - name: Unit & Integration tests with coverage | |
| run: npm test -- --coverage --no-watch --passWithNoTests | |
| env: | |
| NPM_CONFIG_REGISTRY: https://registry.npmjs.org/ | |
| - name: Build package | |
| run: npm run build | |
| env: | |
| NPM_CONFIG_REGISTRY: https://registry.npmjs.org/ | |
| - name: Package sanity check | |
| run: npm run check:package | |
| env: | |
| NPM_CONFIG_REGISTRY: https://registry.npmjs.org/ | |
| - name: Upload coverage artifacts | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: coverage-report | |
| path: coverage/ | |
| retention-days: 30 | |
| - name: Generate coverage summary | |
| if: always() | |
| run: | | |
| echo "## Test Coverage Report" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| if [ -f coverage/coverage-summary.json ]; then | |
| echo "\`\`\`json" >> $GITHUB_STEP_SUMMARY | |
| cat coverage/coverage-summary.json >> $GITHUB_STEP_SUMMARY | |
| echo "\`\`\`" >> $GITHUB_STEP_SUMMARY | |
| else | |
| echo "No coverage summary available" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| - name: Comment coverage on PR | |
| uses: romeovs/lcov-reporter-action@v0.3.1 | |
| if: github.event_name == 'pull_request' | |
| with: | |
| lcov-file: ./coverage/lcov.info | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| delete-old-comments: true | |
| build-ios-example: | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Use Node.js 22 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: "npm" | |
| - name: Install root dependencies | |
| run: npm install | |
| env: | |
| NPM_CONFIG_REGISTRY: https://registry.npmjs.org/ | |
| - name: Install example dependencies | |
| working-directory: example | |
| run: npm install | |
| env: | |
| NPM_CONFIG_REGISTRY: https://registry.npmjs.org/ | |
| - name: Cache CocoaPods | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/Library/Caches/CocoaPods | |
| example/ios/Pods | |
| key: ${{ runner.os }}-pods-${{ hashFiles('example/ios/Podfile.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pods- | |
| - name: Generate iOS project with Expo | |
| working-directory: example | |
| run: npx expo prebuild --platform ios --clean | |
| env: | |
| NPM_CONFIG_REGISTRY: https://registry.npmjs.org/ | |
| - name: Build iOS app for Simulator | |
| working-directory: example | |
| run: | | |
| xcodebuild -workspace ios/reactnativeplaidlinksdkexample.xcworkspace \ | |
| -scheme reactnativeplaidlinksdkexample \ | |
| -sdk iphonesimulator \ | |
| -configuration Release \ | |
| -destination 'platform=iOS Simulator,name=iPhone 16,OS=latest' \ | |
| clean build \ | |
| CODE_SIGNING_ALLOWED=NO \ | |
| | tee xcodebuild.log | |
| - name: Upload build logs | |
| uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: ios-build-logs | |
| path: example/xcodebuild.log | |
| retention-days: 7 | |
| test-android-example: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Use Node.js 22 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: "npm" | |
| - name: Use Java 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 17 | |
| - name: Install root dependencies | |
| run: npm ci | |
| env: | |
| NPM_CONFIG_REGISTRY: https://registry.npmjs.org/ | |
| - name: Install example dependencies | |
| working-directory: example | |
| run: npm install | |
| env: | |
| NPM_CONFIG_REGISTRY: https://registry.npmjs.org/ | |
| - name: Generate Android project with Expo | |
| working-directory: example | |
| run: npx expo prebuild --platform android --clean | |
| env: | |
| NPM_CONFIG_REGISTRY: https://registry.npmjs.org/ | |
| - name: Run Android unit tests | |
| working-directory: example/android | |
| run: ./gradlew testDebugUnitTest |