fix(examples): improve retry backoff and remove OneSignal ID row #74
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: E2E Tests | |
| on: | |
| push: | |
| branches: | |
| - rel/** | |
| workflow_dispatch: | |
| inputs: | |
| platform: | |
| description: 'Platform to test' | |
| required: true | |
| default: 'both' | |
| type: choice | |
| options: | |
| - android | |
| - ios | |
| - both | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-android: | |
| if: >- | |
| github.event_name == 'push' || | |
| github.event.inputs.platform == 'android' || | |
| github.event.inputs.platform == 'both' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Set up Flutter | |
| uses: ./.github/actions/setup-flutter | |
| with: | |
| working-directory: examples/demo | |
| - name: Set up Android build | |
| uses: ./.github/actions/setup-android-build | |
| - name: Create demo .env | |
| uses: ./.github/actions/create-demo-env | |
| with: | |
| onesignal-app-id: ${{ vars.APPIUM_ONESIGNAL_APP_ID }} | |
| onesignal-api-key: ${{ secrets.APPIUM_ONESIGNAL_API_KEY }} | |
| - name: Resolve OneSignal Android SDK version | |
| id: android-sdk-version | |
| run: | | |
| VERSION=$(grep "com.onesignal:OneSignal:" android/build.gradle | sed -E "s/.*OneSignal:([^\"']+).*/\1/") | |
| echo "version=${VERSION}" >> "$GITHUB_OUTPUT" | |
| - name: Wait for OneSignal Android SDK on Maven Central | |
| uses: OneSignal/sdk-shared/.github/actions/wait-for-maven-artifact@main | |
| with: | |
| version: ${{ steps.android-sdk-version.outputs.version }} | |
| - name: Build release APK | |
| working-directory: examples/demo | |
| run: flutter build apk --release | |
| - name: Upload APK | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: demo-apk | |
| path: examples/demo/build/app/outputs/flutter-apk/app-release.apk | |
| retention-days: 1 | |
| compression-level: 0 | |
| build-ios: | |
| if: >- | |
| github.event_name == 'push' || | |
| github.event.inputs.platform == 'ios' || | |
| github.event.inputs.platform == 'both' | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Set up Flutter | |
| uses: ./.github/actions/setup-flutter | |
| with: | |
| working-directory: examples/demo | |
| - name: Set up iOS build | |
| uses: ./.github/actions/setup-ios-build | |
| - name: Create demo .env | |
| uses: ./.github/actions/create-demo-env | |
| with: | |
| onesignal-app-id: ${{ vars.APPIUM_ONESIGNAL_APP_ID }} | |
| onesignal-api-key: ${{ secrets.APPIUM_ONESIGNAL_API_KEY }} | |
| - name: Set up iOS codesigning | |
| uses: OneSignal/sdk-shared/.github/actions/setup-ios-demo-codesigning@main | |
| with: | |
| p12-base64: ${{ secrets.APPIUM_IOS_DEV_CERT_P12_BASE64 }} | |
| p12-password: ${{ secrets.APPIUM_IOS_DEV_CERT_PASSWORD }} | |
| asc-key-id: ${{ secrets.APPIUM_APP_STORE_CONNECT_KEY_ID }} | |
| asc-issuer-id: ${{ secrets.APPIUM_APP_STORE_CONNECT_ISSUER_ID }} | |
| asc-private-key: ${{ secrets.APPIUM_APP_STORE_CONNECT_PRIVATE_KEY }} | |
| - name: Build signed IPA | |
| working-directory: examples/demo | |
| run: | | |
| flutter build ipa --release \ | |
| --export-options-plist=ios/ExportOptions.plist \ | |
| --split-debug-info=build/symbols | |
| shopt -s nullglob | |
| ipas=(build/ios/ipa/*.ipa) | |
| if [ ${#ipas[@]} -eq 0 ]; then | |
| echo "::error::No IPA was produced in build/ios/ipa" | |
| exit 1 | |
| fi | |
| src="${ipas[0]}" | |
| dst="build/ios/ipa/Runner.ipa" | |
| if [ "$src" != "$dst" ]; then | |
| cp "$src" "$dst" | |
| fi | |
| - name: Verify aps-environment in IPA | |
| working-directory: examples/demo | |
| run: | | |
| unzip -oq build/ios/ipa/Runner.ipa -d /tmp/ipa | |
| APP=$(ls -d /tmp/ipa/Payload/*.app | head -n1) | |
| codesign -d --entitlements - "$APP" 2>&1 | tee /tmp/entitlements.txt | |
| if ! grep -q 'aps-environment' /tmp/entitlements.txt; then | |
| echo "::error::Built IPA is missing aps-environment entitlement; push subscription will not work" | |
| exit 1 | |
| fi | |
| - name: Upload IPA | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: demo-ipa | |
| path: examples/demo/build/ios/ipa/Runner.ipa | |
| retention-days: 1 | |
| compression-level: 0 | |
| e2e-android: | |
| needs: build-android | |
| uses: OneSignal/sdk-shared/.github/workflows/appium-e2e.yml@main | |
| secrets: inherit | |
| with: | |
| platform: android | |
| app-artifact: demo-apk | |
| app-filename: app-release.apk | |
| sdk-type: flutter | |
| build-name: flutter-android-${{ github.ref_name }}-${{ github.run_number }} | |
| e2e-ios: | |
| needs: build-ios | |
| uses: OneSignal/sdk-shared/.github/workflows/appium-e2e.yml@main | |
| secrets: inherit | |
| with: | |
| platform: ios | |
| app-artifact: demo-ipa | |
| app-filename: Runner.ipa | |
| sdk-type: flutter | |
| build-name: flutter-ios-${{ github.ref_name }}-${{ github.run_number }} |