Browse Source

CI: Add Codecov token to artifact action (#48375)

Matt Gaunt-Seo @ Sentry.io 1 year ago
parent
commit
2303b86f7d

+ 4 - 0
.github/actions/artifacts/action.yml

@@ -10,6 +10,9 @@ inputs:
     description: "The type of change (frontend, backend)"
     default: "backend"
     required: false
+  token:
+    description: "The codecov token"
+    required: true
 
 runs:
   using: "composite"
@@ -17,6 +20,7 @@ runs:
     - name: Upload to codecov
       uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378  # v3.1.0
       with:
+        token: ${{ inputs.token }}
         flags: ${{ inputs.type }}
         files: ${{ inputs.files }}
         verbose: true

+ 2 - 0
.github/workflows/acceptance.yml

@@ -126,6 +126,8 @@ jobs:
       - name: Handle artifacts
         uses: ./.github/actions/artifacts
         if: ${{ always() && needs.files-changed.outputs.backend_all == 'true' }}
+        with:
+          token: ${{ secrets.CODECOV_TOKEN }}
 
   acceptance-required-checks:
     # this is a required check so we need this job to always run and report a status.

+ 12 - 0
.github/workflows/backend.yml

@@ -108,6 +108,8 @@ jobs:
       - name: Handle artifacts
         if: ${{ always() }}
         uses: ./.github/actions/artifacts
+        with:
+          token: ${{ secrets.CODECOV_TOKEN }}
 
   backend-migration-tests:
     if: needs.files-changed.outputs.backend == 'true'
@@ -142,6 +144,8 @@ jobs:
       - name: Handle artifacts
         if: ${{ always() }}
         uses: ./.github/actions/artifacts
+        with:
+          token: ${{ secrets.CODECOV_TOKEN }}
 
   cli:
     if: needs.files-changed.outputs.backend == 'true'
@@ -170,6 +174,8 @@ jobs:
       - name: Handle artifacts
         if: ${{ always() }}
         uses: ./.github/actions/artifacts
+        with:
+          token: ${{ secrets.CODECOV_TOKEN }}
 
   requirements:
     if: needs.files-changed.outputs.backend_dependencies == 'true'
@@ -350,6 +356,8 @@ jobs:
       - name: Handle artifacts
         if: ${{ always() }}
         uses: ./.github/actions/artifacts
+        with:
+          token: ${{ secrets.CODECOV_TOKEN }}
 
   snuba:
     if: needs.files-changed.outputs.backend == 'true'
@@ -391,6 +399,8 @@ jobs:
       - name: Handle artifacts
         if: ${{ always() }}
         uses: ./.github/actions/artifacts
+        with:
+          token: ${{ secrets.CODECOV_TOKEN }}
 
   symbolicator:
     if: needs.files-changed.outputs.backend == 'true'
@@ -433,6 +443,8 @@ jobs:
       - name: Handle artifacts
         if: ${{ always() }}
         uses: ./.github/actions/artifacts
+        with:
+          token: ${{ secrets.CODECOV_TOKEN }}
 
   typing:
     if: needs.files-changed.outputs.backend == 'true'

+ 2 - 0
.github/workflows/development-environment.yml

@@ -117,6 +117,8 @@ jobs:
         run: make test-tools
       - name: Handle artifacts
         uses: ./.github/actions/artifacts
+        with:
+          token: ${{ secrets.CODECOV_TOKEN }}
 
   # We don't yet test the bootstrap step
   # https://github.com/getsentry/bootstrap-sentry/blob/7af557be84920dd587e48613dbc308c937bc0e08/bootstrap.sh#L618-L619

+ 1 - 0
.github/workflows/frontend.yml

@@ -203,6 +203,7 @@ jobs:
         with:
           files: .artifacts/coverage/*
           type: frontend
+          token: ${{ secrets.CODECOV_TOKEN }}
 
   # This check runs once all dependant jobs have passed
   # It symbolizes that all required Frontend checks have succesfully passed (Or skipped)

+ 0 - 3
.github/workflows/shuffle-tests.yml

@@ -53,6 +53,3 @@ jobs:
       - name: Run backend test (${{ steps.setup.outputs.matrix-instance-number }} of ${{ steps.setup.outputs.matrix-instance-total }})
         run: |
           make test-python-ci
-
-      - name: Handle artifacts
-        uses: ./.github/actions/artifacts