spectesting.yml 2.6 KB

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