fix(push): reregister iOS event handlers on changeApplicationCode #360
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: On Commit | |
on: | |
push: | |
branches: [ master ] | |
workflow_dispatch: | |
env: | |
DISTRIBUTION_CERT_BASE64: ${{ secrets.DISTRIBUTION_CERT_BASE64 }} | |
DISTRIBUTION_CERT_PASS: ${{ secrets.DISTRIBUTION_CERT_PASS }} | |
EXAMPLE_PROV_PROF_BASE64: ${{ secrets.EXAMPLE_PROV_PROF_BASE64 }} | |
EXAMPLE_NOTIFICATION_SERVICE_PROV_PROF_BASE64: ${{ secrets.EXAMPLE_NOTIFICATION_SERVICE_PROV_PROF_BASE64 }} | |
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }} | |
SLACK_ICON: https://icons.iconarchive.com/icons/martz90/circle/256/android-icon.png | |
SLACK_TITLE: Commit status | |
SLACK_USERNAME: Emarsys SDK - Flutter | |
SLACK_WEBHOOK: ${{ secrets.SLACK_MOBILE_TEAM_CI_CHANNEL_WEBHOOK }} | |
jobs: | |
Android: | |
needs: [Lint] | |
runs-on: macos-15 | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: set up JDK 17 | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- name: Setup flutter env | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: "3.35.1" | |
architecture: x64 | |
channel: "stable" | |
- name: Update dependencies | |
run: flutter pub get | |
- name: Install Google Services JSON | |
uses: davidSchuppa/base64Secret-toFile-action@v1 | |
with: | |
secret: ${{ secrets.GOOGLE_SERVICE_JSON_BASE64 }} | |
filename: google-services.json | |
destination-path: ./example/android/app/ | |
- name: Run Android unit tests with gradle | |
run: (cd example/android && ./gradlew clean testDebugUnitTest -x lint -x :integration_test:testDebugUnitTest -x :integration_test:testProfileUnitTest -x :integration_test:testReleaseUnitTest) | |
IOS: | |
runs-on: macos-15 | |
needs: [Lint] | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Setup flutter env | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: "3.35.1" | |
architecture: x64 | |
channel: "stable" | |
- name: Update dependencies | |
run: flutter pub get | |
- name: Use Xcode 16.4 | |
run: sudo xcode-select -switch /Applications/Xcode_16.4.app | |
- name: Open simulator | |
run: open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/ | |
- name: Remove old directories | |
run: rm -rf ~/tmp | rm -rf ~/Library/MobileDevice | |
shell: bash | |
- name: Import Distribution Certificate | |
uses: apple-actions/import-codesign-certs@v5 | |
with: | |
p12-file-base64: ${{ secrets.DISTRIBUTION_CERT_BASE64 }} | |
p12-password: ${{ secrets.DISTRIBUTION_CERT_PASS }} | |
- name: Setup Example Provisioning Profile | |
uses: davidSchuppa/base64Secret-toFile-action@v1 | |
with: | |
destination-path: ~/Library/MobileDevice/Provisioning\ Profiles/ | |
filename: FlutterExampleProvProf.mobileprovision | |
secret: ${{ secrets.EXAMPLE_PROV_PROF_BASE64 }} | |
- name: Setup ExampleNotificationService Provisioning Profile | |
uses: davidSchuppa/base64Secret-toFile-action@v1 | |
with: | |
destination-path: ~/Library/MobileDevice/Provisioning\ Profiles/ | |
filename: FlutterExampleNotificationServiceProvProf.mobileprovision | |
secret: ${{ secrets.EXAMPLE_NOTIFICATION_SERVICE_PROV_PROF_BASE64 }} | |
- name: Install Dependencies | |
run: (cd example/ios && pod install --no-repo-update) | |
shell: bash | |
- name: Run iOS unit tests | |
run: xcodebuild -workspace ~/work/flutter-plugin-for-sap-emarsys-customer-engagement/flutter-plugin-for-sap-emarsys-customer-engagement/example/ios/Runner.xcworkspace -scheme RunnerTests -configuration Debug -destination 'platform=iOS Simulator,name=iPhone 16 Pro,OS=18.6' test | |
Flutter: | |
runs-on: macos-15 | |
needs: [ Lint ] | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Setup flutter env | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: "3.35.1" | |
architecture: x64 | |
channel: "stable" | |
- name: Update dependencies | |
run: flutter pub get | |
- name: Install Dependencies | |
run: (cd example/ios && pod install --no-repo-update --verbose) | |
shell: bash | |
- name: Run Flutter Tests | |
run: flutter test | |
Lint: | |
runs-on: macos-15 | |
steps: | |
- name: Setup flutter env | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: "3.35.1" | |
architecture: x64 | |
channel: "stable" | |
- name: Flutter lint | |
run: dart analyze | |
shell: bash |