diff --git a/.github/actions/artifacts/action.yml b/.github/actions/artifacts/action.yml index d79a9228750744..7fb0a7f2958108 100644 --- a/.github/actions/artifacts/action.yml +++ b/.github/actions/artifacts/action.yml @@ -1,13 +1,26 @@ name: 'Sentry Artifacts' description: 'Handles uploading coverage/test artifacts to codecov' +inputs: + files: + description: "Path to coverage file(s) - comma separated for multiple files" + default: ".artifacts/*.coverage.xml" + required: true + type: + description: "The type of change (frontend, backend)" + default: "backend" + required: false + runs: using: "composite" steps: - name: Upload to codecov - shell: bash - run: | - coverage_files=$(ls .artifacts/*coverage.xml || true) - if [[ -n "$coverage_files" || -f .artifacts/coverage/cobertura-coverage.xml ]]; then - bash <(curl -s https://codecov.io/bash) -v - fi + uses: codecov/codecov-action@v2 + env: + # This is because of a bug in codecov's uploader + # See: https://github.com/codecov/uploader/issues/475 + NODE_OPTIONS: "" + with: + flags: ${{ inputs.type }} + files: ${{ inputs.files }} + verbose: true diff --git a/.github/workflows/acceptance.yml b/.github/workflows/acceptance.yml index b1738434281df4..98c6d276d41daf 100644 --- a/.github/workflows/acceptance.yml +++ b/.github/workflows/acceptance.yml @@ -88,6 +88,9 @@ jobs: - name: Handle artifacts uses: ./.github/actions/artifacts + with: + files: .artifacts/coverage/* + type: frontend webpack: name: create frontend bundle @@ -209,8 +212,17 @@ jobs: save-only: true snapshot-path: .artifacts/visual-snapshots + # We use the below to determine the flag to use in codecov + - name: Check for python file changes + uses: getsentry/paths-filter@v2 + id: changes + with: + token: ${{ github.token }} + filters: .github/file-filters.yml + - name: Handle artifacts uses: ./.github/actions/artifacts + if: ${{ steps.changes.outputs.backend == 'true' }} chartcuterie: name: chartcuterie integration diff --git a/Makefile b/Makefile index 32371ed820ae37..65ebbcd11deb83 100644 --- a/Makefile +++ b/Makefile @@ -161,7 +161,7 @@ test-plugins: test-relay-integration: @echo "--> Running Relay integration tests" - pytest tests/relay_integration -vv + pytest tests/relay_integration -vv --cov . --cov-report="xml:.artifacts/relay.coverage.xml" --junit-xml=".artifacts/relay.junit.xml" @echo "" test-api-docs: build-api-docs