fix: add example test folder inside sample and fix tests #424
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: CI/CD | |
| env: | |
| NODE_JS_VERSION: 20.19.5 | |
| on: | |
| pull_request: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| jobs: | |
| test-rn: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v1 | |
| - name: Use Node.js "$NODE_JS_VERSION" | |
| uses: actions/setup-node@v2 | |
| with: | |
| node-version: ${{ env.NODE_JS_VERSION }} | |
| - name: Install Dependencies | |
| run: yarn install --frozen-lockfile | |
| - name: Install TypeScript | |
| run: yarn add --dev typescript@^5.6.3 | |
| - name: Compile TypeScript | |
| run: yarn compile | |
| - name: Run Tests | |
| run: yarn test | |
| - name: Assert that every file that should be public has been exported | |
| run: ./scripts/assert_export.sh | |
| test-ios: | |
| needs: test-rn | |
| runs-on: macos-14 | |
| steps: | |
| - uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: '16.1' | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| - name: Setup Node | |
| uses: actions/setup-node@v2 | |
| with: | |
| node-version: ${{ env.NODE_JS_VERSION }} | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.2' | |
| - name: Install SDK Dependencies | |
| run: yarn install --frozen-lockfile | |
| - name: Compile SDK | |
| run: yarn compile | |
| - name: Install Sample Dependencies | |
| working-directory: ./sample | |
| run: npm ci --legacy-peer-deps | |
| - name: Bundle install (Ruby gems) | |
| working-directory: ./sample | |
| run: | | |
| bundle config set path 'vendor/bundle' | |
| bundle install --jobs 4 --retry 3 | |
| - name: Install pods (via bundler) | |
| working-directory: ./sample | |
| run: cd ios && bundle exec pod install --repo-update | |
| - name: Run tests | |
| working-directory: ./sample | |
| run: cd ios && set -o pipefail && xcodebuild -workspace sample.xcworkspace -scheme "sample" -sdk iphonesimulator -destination 'platform=iOS Simulator,OS=17.5,name=iPhone 15' -parallel-testing-enabled NO -parallel-testing-worker-count 1 -only-testing:sampleTests - test | bundle exec xcpretty && exit ${PIPESTATUS[0]} | |
| test-android: | |
| needs: test-rn | |
| runs-on: macOS-13 | |
| env: | |
| GRADLE_VERSION: 8.13 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v2 | |
| with: | |
| node-version: ${{ env.NODE_JS_VERSION }} | |
| - name: Java 17 | |
| uses: actions/setup-java@v1 | |
| with: | |
| java-version: 17 | |
| - name: Install SDK Dependencies | |
| run: yarn install --frozen-lockfile | |
| - name: Compile SDK | |
| run: yarn compile | |
| - name: Install Sample Dependencies (needed for Gradle build) | |
| working-directory: ./sample | |
| run: npm ci --legacy-peer-deps | |
| - name: Run SDK Unit Tests | |
| working-directory: ./sample/android | |
| run: ./gradlew :react-native-usercentrics:test |