ci(repo): mock firebase for e2e tests #119
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: E2E Tests | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| ALLURE_TOKEN: ${{ secrets.ALLURE_TOKEN }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GITHUB_PR_NUM: ${{ github.event.pull_request.number }} | |
| jobs: | |
| android: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 40 | |
| env: | |
| ANDROID_API_LEVEL: "34" | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: ./.github/actions/setup-java | |
| - uses: ./.github/actions/cache-gradle | |
| - uses: ./.github/actions/setup-ruby | |
| - uses: ./.github/actions/setup-flutter | |
| - uses: ./.github/actions/enable-kvm | |
| - name: Bootstrap | |
| run: | | |
| flutter pub global activate melos | |
| melos bootstrap | |
| - name: Launch Allure TestOps | |
| working-directory: sample_app/android | |
| run: bundle exec fastlane allure_launch | |
| env: | |
| GITHUB_EVENT: ${{ toJson(github.event) }} | |
| - name: Run e2e (Android emulator) | |
| uses: reactivecircus/android-emulator-runner@v2 | |
| with: | |
| api-level: ${{ env.ANDROID_API_LEVEL }} | |
| arch: x86_64 | |
| profile: pixel_6 | |
| script: cd sample_app/android && bundle exec fastlane run_e2e_test device:emulator-5554 | |
| - name: Upload Allure results | |
| if: env.LAUNCH_ID != '' && (success() || failure()) | |
| working-directory: sample_app/android | |
| run: bundle exec fastlane allure_upload launch_id:$LAUNCH_ID | |
| - name: Allure TestOps Launch Removal | |
| if: env.LAUNCH_ID != '' && cancelled() | |
| working-directory: sample_app/android | |
| run: bundle exec fastlane allure_launch_removal launch_id:$LAUNCH_ID | |
| - uses: actions/upload-artifact@v7 | |
| if: failure() | |
| with: | |
| name: e2e-android-logs | |
| path: | | |
| sample_app/stream-chat-test-mock-server/logs | |
| sample_app/build/e2e-test.log | |
| ios: | |
| runs-on: macos-15 | |
| timeout-minutes: 40 | |
| env: | |
| IOS_SIMULATOR_VERSION: "26.2" | |
| IOS_SIMULATOR_DEVICE: "iPhone 17" | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: ./.github/actions/setup-flutter | |
| - uses: ./.github/actions/setup-ruby | |
| - name: Use Firebase stubs | |
| run: cp sample_app/pubspec_overrides.e2e.yaml sample_app/pubspec_overrides.yaml | |
| - name: Bootstrap | |
| run: | | |
| flutter precache --ios | |
| flutter config --no-enable-swift-package-manager | |
| flutter pub global activate melos | |
| melos bootstrap | |
| # After Bootstrap so the cache keys hash the resolved pubspec.lock | |
| - uses: ./.github/actions/cache-cocoapods | |
| with: | |
| key-suffix: ${{ runner.os }} | |
| - name: Launch Allure TestOps | |
| working-directory: sample_app/ios | |
| run: bundle exec fastlane allure_launch | |
| env: | |
| GITHUB_EVENT: ${{ toJson(github.event) }} | |
| - name: Run e2e (iOS simulator) | |
| working-directory: sample_app/ios | |
| run: bundle exec fastlane run_e2e_test platform:ios ios:"${{ env.IOS_SIMULATOR_VERSION }}" device:"${{ env.IOS_SIMULATOR_DEVICE }}" | |
| - name: Upload Allure results | |
| if: env.LAUNCH_ID != '' && (success() || failure()) | |
| working-directory: sample_app/ios | |
| run: bundle exec fastlane allure_upload launch_id:$LAUNCH_ID | |
| - name: Allure TestOps Launch Removal | |
| if: env.LAUNCH_ID != '' && cancelled() | |
| working-directory: sample_app/ios | |
| run: bundle exec fastlane allure_launch_removal launch_id:$LAUNCH_ID | |
| - uses: actions/upload-artifact@v7 | |
| if: failure() | |
| with: | |
| name: e2e-ios-logs | |
| path: | | |
| sample_app/stream-chat-test-mock-server/logs | |
| sample_app/build/e2e-test.log |