codecov_ats.yml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. steps:
  39. - uses: actions/checkout@v3
  40. with:
  41. fetch-depth: 0
  42. - name: Set up Python 3.10.10
  43. uses: actions/setup-python@v4
  44. with:
  45. python-version: "3.10.10"
  46. - name: Setup sentry env
  47. uses: ./.github/actions/setup-sentry
  48. id: setup
  49. with:
  50. snuba: true
  51. # Right now, we run so few bigtable related tests that the
  52. # overhead of running bigtable in all backend tests
  53. # is way smaller than the time it would take to run in its own job.
  54. bigtable: true
  55. pg-version: 14
  56. - name: Download Codecov CLI
  57. run: |
  58. pip install --extra-index-url https://pypi.org/simple --no-cache-dir pytest codecov-cli
  59. # Creates the commit and report objects in codecov
  60. - name: Codecov startup
  61. run: |
  62. codecovcli create-commit
  63. codecovcli create-report
  64. env:
  65. CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
  66. # Sends static analysis information to codecov
  67. - name: Static Analysis
  68. run: |
  69. codecovcli static-analysis --token=${CODECOV_STATIC_TOKEN} \
  70. --folders-to-exclude .artifacts \
  71. --folders-to-exclude .github \
  72. --folders-to-exclude .venv \
  73. --folders-to-exclude static \
  74. --folders-to-exclude bin
  75. env:
  76. CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
  77. CODECOV_STATIC_TOKEN: ${{ secrets.CODECOV_STATIC_TOKEN }}
  78. # Run label analysis IN DRY MODE (no tests will actually run)
  79. - name: Label Analysis
  80. continue-on-error: true
  81. run: |
  82. BASE_COMMIT=$(git merge-base ${{ github.sha }}^ origin/master)
  83. echo $BASE_COMMIT
  84. codecovcli --codecov-yml-path=codecov.yml label-analysis --dry-run --token=${CODECOV_STATIC_TOKEN} --base-sha=${BASE_COMMIT}
  85. env:
  86. CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
  87. CODECOV_STATIC_TOKEN: ${{ secrets.CODECOV_STATIC_TOKEN }}