spectesting.yml 2.7 KB

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