abtesting.yml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. name: abtesting
  2. on:
  3. pull_request:
  4. paths:
  5. - 'FirebaseABTesting**'
  6. - 'Interop/Analytics/Public/*.h'
  7. - '.github/workflows/abtesting.yml'
  8. - 'Gemfile'
  9. schedule:
  10. # Run every day at 11pm (PST) - cron uses UTC times
  11. - cron: '0 7 * * *'
  12. jobs:
  13. pod-lib-lint:
  14. # Don't run on private repo unless it is a PR.
  15. if: github.repository != 'FirebasePrivate/firebase-ios-sdk' || github.event_name == 'pull_request'
  16. runs-on: macOS-latest
  17. strategy:
  18. matrix:
  19. target: [ios, tvos, macos]
  20. steps:
  21. - uses: actions/checkout@v2
  22. - name: Setup Bundler
  23. run: scripts/setup_bundler.sh
  24. - name: Build and test
  25. run: |
  26. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseABTesting.podspec \
  27. --platforms=${{ matrix.target }}
  28. spm:
  29. # Don't run on private repo unless it is a PR.
  30. if: github.repository != 'FirebasePrivate/firebase-ios-sdk' || github.event_name == 'pull_request'
  31. runs-on: macOS-latest
  32. steps:
  33. - uses: actions/checkout@v2
  34. - name: Xcode 12
  35. run: sudo xcode-select -s /Applications/Xcode_12_beta.app/Contents/Developer
  36. - name: Initialize xcodebuild
  37. run: xcodebuild -list
  38. - name: iOS Unit Tests
  39. run: scripts/third_party/travis/retry.sh xcodebuild -scheme ABTestingUnit test -sdk
  40. iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 11' | xcpretty
  41. spm-cron:
  42. # Don't run on private repo.
  43. if: github.event_name == 'schedule' && github.repository != 'FirebasePrivate/firebase-ios-sdk'
  44. runs-on: macOS-latest
  45. steps:
  46. - uses: actions/checkout@v2
  47. - name: Xcode 12
  48. run: sudo xcode-select -s /Applications/Xcode_12_beta.app/Contents/Developer
  49. - name: Initialize xcodebuild
  50. run: xcodebuild -list
  51. - name: macOS Unit Tests
  52. run: scripts/third_party/travis/retry.sh xcodebuild -scheme ABTestingUnit test | xcpretty
  53. - name: tvOS Unit Tests
  54. run: scripts/third_party/travis/retry.sh xcodebuild -scheme ABTestingUnit test -sdk
  55. appletvsimulator -destination 'platform=tvOS Simulator,name=Apple TV' | xcpretty
  56. catalyst:
  57. # Don't run on private repo unless it is a PR.
  58. if: github.repository != 'FirebasePrivate/firebase-ios-sdk' || github.event_name == 'pull_request'
  59. runs-on: macOS-latest
  60. steps:
  61. - uses: actions/checkout@v2
  62. - name: Setup Bundler
  63. run: scripts/setup_bundler.sh
  64. - name: Setup project and Build for Catalyst
  65. # Only build the unit tests on Catalyst. Test stopped working when GHA moved to Xcode 11.4.1.
  66. run: scripts/test_catalyst.sh FirebaseABTesting build FirebaseABTesting-Unit-unit
  67. quickstart:
  68. # Don't run on private repo unless it is a PR.
  69. if: github.repository != 'FirebasePrivate/firebase-ios-sdk' || github.event_name == 'pull_request'
  70. env:
  71. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  72. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  73. runs-on: macOS-latest
  74. steps:
  75. - uses: actions/checkout@v2
  76. - name: Setup quickstart
  77. run: scripts/setup_quickstart.sh abtesting
  78. - name: Install Secret GoogleService-Info.plist
  79. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-abtesting.plist.gpg \
  80. quickstart-ios/abtesting/GoogleService-Info.plist "$plist_secret"
  81. - name: Install Secret FIREGSignInInfo.h
  82. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/FIREGSignInInfo.h.gpg \
  83. quickstart-ios/TestUtils/FIREGSignInInfo.h "$signin_secret"
  84. - name: Test swift quickstart
  85. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh ABTesting)
  86. abtesting-cron-only:
  87. # Don't run on private repo.
  88. if: github.event_name == 'schedule' && github.repository != 'FirebasePrivate/firebase-ios-sdk'
  89. runs-on: macos-latest
  90. strategy:
  91. matrix:
  92. target: [ios, tvos, macos]
  93. flags: [
  94. '--use-modular-headers',
  95. '--use-libraries'
  96. ]
  97. needs: pod-lib-lint
  98. steps:
  99. - uses: actions/checkout@v2
  100. - name: Setup Bundler
  101. run: scripts/setup_bundler.sh
  102. - name: PodLibLint ABTesting Cron
  103. run: |
  104. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb \
  105. FirebaseABTesting.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}