spectesting.yml 2.6 KB

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