codecov_ats.yml 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. name: IGNORE ME codecov-ats
  2. on:
  3. pull_request:
  4. env:
  5. CLI_VERSION: v0.1.5
  6. # Cancel in progress workflows on pull_requests.
  7. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
  8. concurrency:
  9. group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
  10. cancel-in-progress: true
  11. jobs:
  12. files-changed:
  13. name: detect what files changed
  14. runs-on: ubuntu-20.04
  15. timeout-minutes: 3
  16. # Map a step output to a job output
  17. outputs:
  18. api_docs: ${{ steps.changes.outputs.api_docs }}
  19. backend: ${{ steps.changes.outputs.backend_all }}
  20. backend_dependencies: ${{ steps.changes.outputs.backend_dependencies }}
  21. backend_any_type: ${{ steps.changes.outputs.backend_any_type }}
  22. migration_lockfile: ${{ steps.changes.outputs.migration_lockfile }}
  23. plugins: ${{ steps.changes.outputs.plugins }}
  24. steps:
  25. - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
  26. - name: Check for backend file changes
  27. uses: getsentry/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
  28. id: changes
  29. with:
  30. token: ${{ github.token }}
  31. filters: .github/file-filters.yml
  32. coverage-ats:
  33. # Temporary test
  34. if: needs.files-changed.outputs.backend == 'true'
  35. needs: files-changed
  36. timeout-minutes: 40
  37. runs-on: ubuntu-latest
  38. strategy:
  39. # This helps not having to run multiple jobs because one fails, thus, reducing resource usage
  40. # and reducing the risk that one of many runs would turn red again (read: intermittent tests)
  41. fail-fast: false
  42. steps:
  43. - uses: actions/checkout@v3
  44. with:
  45. fetch-depth: 0
  46. - name: Set up Python 3.10.10
  47. uses: actions/setup-python@v4
  48. with:
  49. python-version: "3.10.10"
  50. - name: Setup sentry env
  51. uses: ./.github/actions/setup-sentry
  52. id: setup
  53. with:
  54. snuba: true
  55. # Right now, we run so few bigtable related tests that the
  56. # overhead of running bigtable in all backend tests
  57. # is way smaller than the time it would take to run in its own job.
  58. bigtable: true
  59. pg-version: 14
  60. - name: Download Codecov CLI
  61. run: |
  62. pip install --extra-index-url https://pypi.org/simple --no-cache-dir pytest codecov-cli
  63. # Creates the commit and report objects in codecov
  64. - name: Codecov startup
  65. run: |
  66. codecovcli create-commit
  67. codecovcli create-report
  68. env:
  69. CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
  70. # Sends static analysis information to codecov
  71. - name: Static Analysis
  72. run: |
  73. codecovcli static-analysis --token=${CODECOV_STATIC_TOKEN} \
  74. --folders-to-exclude .artifacts \
  75. --folders-to-exclude .github \
  76. --folders-to-exclude .venv \
  77. --folders-to-exclude static \
  78. --folders-to-exclude bin
  79. env:
  80. CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
  81. CODECOV_STATIC_TOKEN: ${{ secrets.CODECOV_STATIC_TOKEN }}
  82. # Run label analysis IN DRY MODE (no tests will actually run)
  83. - name: Label Analysis
  84. continue-on-error: true
  85. run: |
  86. BASE_COMMIT=$(git merge-base ${{ github.sha }}^ origin/master)
  87. echo $BASE_COMMIT
  88. codecovcli --codecov-yml-path=codecov.yml label-analysis --dry-run --token=${CODECOV_STATIC_TOKEN} --base-sha=${BASE_COMMIT}
  89. env:
  90. CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
  91. CODECOV_STATIC_TOKEN: ${{ secrets.CODECOV_STATIC_TOKEN }}