codecov_ats.yml 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. steps:
  24. - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
  25. - name: Check for backend file changes
  26. uses: getsentry/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
  27. id: changes
  28. with:
  29. token: ${{ github.token }}
  30. filters: .github/file-filters.yml
  31. coverage-ats:
  32. # Temporary test
  33. if: needs.files-changed.outputs.backend == 'true'
  34. needs: files-changed
  35. timeout-minutes: 40
  36. runs-on: ubuntu-latest
  37. steps:
  38. - uses: actions/checkout@v3
  39. with:
  40. fetch-depth: 0
  41. - name: Set up Python 3.10.10
  42. uses: actions/setup-python@v4
  43. with:
  44. python-version: "3.10.10"
  45. - name: Setup sentry env
  46. uses: ./.github/actions/setup-sentry
  47. id: setup
  48. with:
  49. snuba: true
  50. # Right now, we run so few bigtable related tests that the
  51. # overhead of running bigtable in all backend tests
  52. # is way smaller than the time it would take to run in its own job.
  53. bigtable: true
  54. pg-version: 14
  55. - name: Download Codecov CLI
  56. run: |
  57. pip install --extra-index-url https://pypi.org/simple --no-cache-dir pytest codecov-cli
  58. # Creates the commit and report objects in codecov
  59. - name: Codecov startup
  60. run: |
  61. codecovcli create-commit
  62. codecovcli create-report
  63. env:
  64. CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
  65. # Sends static analysis information to codecov
  66. - name: Static Analysis
  67. run: |
  68. codecovcli static-analysis --token=${CODECOV_STATIC_TOKEN} \
  69. --folders-to-exclude .artifacts \
  70. --folders-to-exclude .github \
  71. --folders-to-exclude .venv \
  72. --folders-to-exclude static \
  73. --folders-to-exclude bin
  74. env:
  75. CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
  76. CODECOV_STATIC_TOKEN: ${{ secrets.CODECOV_STATIC_TOKEN }}
  77. # Run label analysis IN DRY MODE (no tests will actually run)
  78. - name: Label Analysis
  79. continue-on-error: true
  80. run: |
  81. BASE_COMMIT=$(git merge-base ${{ github.sha }}^ origin/master)
  82. echo $BASE_COMMIT
  83. codecovcli --codecov-yml-path=codecov.yml label-analysis --dry-run --token=${CODECOV_STATIC_TOKEN} --base-sha=${BASE_COMMIT}
  84. env:
  85. CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
  86. CODECOV_STATIC_TOKEN: ${{ secrets.CODECOV_STATIC_TOKEN }}