spectesting.yml 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. name: spectesting
  2. on:
  3. pull_request
  4. jobs:
  5. specs_checking:
  6. # Don't run on private repo unless it is a PR.
  7. if: github.repository == 'Firebase/firebase-ios-sdk'
  8. runs-on: macos-11
  9. outputs:
  10. matrix: ${{ steps.check_files.outputs.matrix }}
  11. podspecs: ${{ steps.check_files.outputs.podspecs }}
  12. steps:
  13. - name: Checkout code
  14. uses: actions/checkout@v2
  15. with:
  16. fetch-depth: 0
  17. - name: check files
  18. id: check_files
  19. env:
  20. pr_branch: ${{ github.event.pull_request.head.ref }}
  21. run: |
  22. # The output.json will have podspecs that will be tested.
  23. # ``` output.json
  24. # [{"podspec":"FirebaseABTesting.podspec"},{"podspec":"FirebaseAnalytics.podspec.json"}]
  25. # ```
  26. # This array will help generate a matrix for jobs in GHA, taking
  27. # advantage of `include`.
  28. # https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#example-including-additional-values-into-combinations
  29. # The final matrix will be set as an env var in the GHA workflow,
  30. # This env var, matrix, will be passed as a matrix in the next job of
  31. # the workflow.
  32. # If multiple podspecs need to be excluded, escaping space is required
  33. # to split podspecs, e.g. get_updated_files.sh ... -e Firebase.podspec\ FirebaseABTesting.podspec
  34. ./scripts/health_metrics/get_updated_files.sh -p output.json -e Firebase.podspec\ FirebaseFunctions.podspec
  35. echo "::set-output name=matrix::{\"include\":$( cat output.json )}"
  36. # `podspecs` is to help determine if specs_testing job should be run.
  37. echo "::set-output name=podspecs::$(cat output.json)"
  38. # TODO(v9): Re-enable once `v9` merges back to `master`.
  39. # specs_testing:
  40. # needs: specs_checking
  41. # if: ${{ needs.specs_checking.outputs.podspecs != '[]' }}
  42. # runs-on: macos-11
  43. # strategy:
  44. # fail-fast: false
  45. # matrix: ${{fromJson(needs.specs_checking.outputs.matrix)}}
  46. # env:
  47. # PODSPEC: ${{ matrix.podspec }}
  48. # steps:
  49. # - name: Checkout code
  50. # uses: actions/checkout@v2
  51. # with:
  52. # fetch-depth: 0
  53. # - name: Init podspecs and source
  54. # run: |
  55. # mkdir specTestingLogs
  56. # cd ReleaseTooling
  57. # swift run podspecs-tester --git-root "${GITHUB_WORKSPACE}" --podspec ${PODSPEC} --skip-tests --temp-log-dir "${GITHUB_WORKSPACE}/specTestingLogs"
  58. # - name: Upload Failed Testing Logs
  59. # if: failure()
  60. # uses: actions/upload-artifact@v2
  61. # with:
  62. # name: specTestingLogs
  63. # path: specTestingLogs/*.txt