Skip to content

Commit

Permalink
fix: make codecov report to work on jobs re-run (#5991)
Browse files Browse the repository at this point in the history
* Use codecov bash uploader instead of gh action

* fix: replace + with coalesce operator (//)

* fix: remove extra character added by mistake
  • Loading branch information
leio10 committed Apr 23, 2020
1 parent b5620bf commit b5c8775
Show file tree
Hide file tree
Showing 25 changed files with 60 additions and 96 deletions.
14 changes: 14 additions & 0 deletions .github/upload_coverage.sh
@@ -0,0 +1,14 @@
#!/bin/bash

REPORT_NAME=$1
EVENT_PAYLOAD_FILE=$2

PRID=`jq ".number // .check_run.pull_requests[0].number" $EVENT_PAYLOAD_FILE`
SHA=`jq -r ".pull_request.head.sha // .check_run.head_sha // .after" $EVENT_PAYLOAD_FILE`

if [ $PRID = "null" ]
then
bash <(curl -s https://codecov.io/bash) -n $REPORT_NAME -C $SHA
else
bash <(curl -s https://codecov.io/bash) -n $REPORT_NAME -C $SHA -P $PRID
fi
6 changes: 2 additions & 4 deletions .github/workflows/ci_accountability.yml
Expand Up @@ -65,10 +65,8 @@ jobs:
- run: bundle exec rake
name: RSpec
working-directory: ${{ env.DECIDIM_MODULE }}
- uses: codecov/codecov-action@v1
with:
file: ./coverage/coverage.xml
name: ${{ env.DECIDIM_MODULE }}
- run: ./.github/upload_coverage.sh $DECIDIM_MODULE $GITHUB_EVENT_PATH
name: Upload coverage
- uses: actions/upload-artifact@v2-preview
if: always()
with:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/ci_admin.yml
Expand Up @@ -65,10 +65,8 @@ jobs:
- run: bundle exec rake
name: RSpec
working-directory: ${{ env.DECIDIM_MODULE }}
- uses: codecov/codecov-action@v1
with:
file: ./coverage/coverage.xml
name: ${{ env.DECIDIM_MODULE }}
- run: ./.github/upload_coverage.sh $DECIDIM_MODULE $GITHUB_EVENT_PATH
name: Upload coverage
- uses: actions/upload-artifact@v2-preview
if: always()
with:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/ci_api.yml
Expand Up @@ -65,10 +65,8 @@ jobs:
- run: bundle exec rake
name: RSpec
working-directory: ${{ env.DECIDIM_MODULE }}
- uses: codecov/codecov-action@v1
with:
file: ./coverage/coverage.xml
name: ${{ env.DECIDIM_MODULE }}
- run: ./.github/upload_coverage.sh $DECIDIM_MODULE $GITHUB_EVENT_PATH
name: Upload coverage
- uses: actions/upload-artifact@v2-preview
if: always()
with:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/ci_assemblies.yml
Expand Up @@ -65,10 +65,8 @@ jobs:
- run: bundle exec rake
name: RSpec
working-directory: ${{ env.DECIDIM_MODULE }}
- uses: codecov/codecov-action@v1
with:
file: ./coverage/coverage.xml
name: ${{ env.DECIDIM_MODULE }}
- run: ./.github/upload_coverage.sh $DECIDIM_MODULE $GITHUB_EVENT_PATH
name: Upload coverage
- uses: actions/upload-artifact@v2-preview
if: always()
with:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/ci_blogs.yml
Expand Up @@ -65,10 +65,8 @@ jobs:
- run: bundle exec rake
name: RSpec
working-directory: ${{ env.DECIDIM_MODULE }}
- uses: codecov/codecov-action@v1
with:
file: ./coverage/coverage.xml
name: ${{ env.DECIDIM_MODULE }}
- run: ./.github/upload_coverage.sh $DECIDIM_MODULE $GITHUB_EVENT_PATH
name: Upload coverage
- uses: actions/upload-artifact@v2-preview
if: always()
with:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/ci_budgets.yml
Expand Up @@ -65,10 +65,8 @@ jobs:
- run: bundle exec rake
name: RSpec
working-directory: ${{ env.DECIDIM_MODULE }}
- uses: codecov/codecov-action@v1
with:
file: ./coverage/coverage.xml
name: ${{ env.DECIDIM_MODULE }}
- run: ./.github/upload_coverage.sh $DECIDIM_MODULE $GITHUB_EVENT_PATH
name: Upload coverage
- uses: actions/upload-artifact@v2-preview
if: always()
with:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/ci_comments.yml
Expand Up @@ -73,10 +73,8 @@ jobs:
- run: bundle exec rake
name: RSpec
working-directory: ${{ env.DECIDIM_MODULE }}
- uses: codecov/codecov-action@v1
with:
file: ./coverage/coverage.xml
name: ${{ env.DECIDIM_MODULE }}
- run: ./.github/upload_coverage.sh $DECIDIM_MODULE $GITHUB_EVENT_PATH
name: Upload coverage
- uses: actions/upload-artifact@v2-preview
if: always()
with:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/ci_conferences.yml
Expand Up @@ -65,10 +65,8 @@ jobs:
- run: bundle exec rake
name: RSpec
working-directory: ${{ env.DECIDIM_MODULE }}
- uses: codecov/codecov-action@v1
with:
file: ./coverage/coverage.xml
name: ${{ env.DECIDIM_MODULE }}
- run: ./.github/upload_coverage.sh $DECIDIM_MODULE $GITHUB_EVENT_PATH
name: Upload coverage
- uses: actions/upload-artifact@v2-preview
if: always()
with:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/ci_consultations.yml
Expand Up @@ -68,10 +68,8 @@ jobs:
- run: bundle exec rake
name: RSpec
working-directory: ${{ env.DECIDIM_MODULE }}
- uses: codecov/codecov-action@v1
with:
file: ./coverage/coverage.xml
name: ${{ env.DECIDIM_MODULE }}
- run: ./.github/upload_coverage.sh $DECIDIM_MODULE $GITHUB_EVENT_PATH
name: Upload coverage
- uses: actions/upload-artifact@v2-preview
if: always()
with:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/ci_core.yml
Expand Up @@ -65,10 +65,8 @@ jobs:
- run: bundle exec rake
name: RSpec
working-directory: ${{ env.DECIDIM_MODULE }}
- uses: codecov/codecov-action@v1
with:
file: ./coverage/coverage.xml
name: ${{ env.DECIDIM_MODULE }}
- run: ./.github/upload_coverage.sh $DECIDIM_MODULE $GITHUB_EVENT_PATH
name: Upload coverage
- uses: actions/upload-artifact@v2-preview
if: always()
with:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/ci_debates.yml
Expand Up @@ -65,10 +65,8 @@ jobs:
- run: bundle exec rake
name: RSpec
working-directory: ${{ env.DECIDIM_MODULE }}
- uses: codecov/codecov-action@v1
with:
file: ./coverage/coverage.xml
name: ${{ env.DECIDIM_MODULE }}
- run: ./.github/upload_coverage.sh $DECIDIM_MODULE $GITHUB_EVENT_PATH
name: Upload coverage
- uses: actions/upload-artifact@v2-preview
if: always()
with:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/ci_forms.yml
Expand Up @@ -65,10 +65,8 @@ jobs:
- run: bundle exec rake
name: RSpec
working-directory: ${{ env.DECIDIM_MODULE }}
- uses: codecov/codecov-action@v1
with:
file: ./coverage/coverage.xml
name: ${{ env.DECIDIM_MODULE }}
- run: ./.github/upload_coverage.sh $DECIDIM_MODULE $GITHUB_EVENT_PATH
name: Upload coverage
- uses: actions/upload-artifact@v2-preview
if: always()
with:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/ci_initiatives.yml
Expand Up @@ -65,10 +65,8 @@ jobs:
- run: bundle exec rake
name: RSpec
working-directory: ${{ env.DECIDIM_MODULE }}
- uses: codecov/codecov-action@v1
with:
file: ./coverage/coverage.xml
name: ${{ env.DECIDIM_MODULE }}
- run: ./.github/upload_coverage.sh $DECIDIM_MODULE $GITHUB_EVENT_PATH
name: Upload coverage
- uses: actions/upload-artifact@v2-preview
if: always()
with:
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/ci_main.yml
Expand Up @@ -49,7 +49,3 @@ jobs:
name: Install JS deps
- run: bundle exec rspec
name: RSpec
- uses: codecov/codecov-action@v1
with:
file: ./coverage/coverage.xml
name: main-folder
6 changes: 2 additions & 4 deletions .github/workflows/ci_meetings.yml
Expand Up @@ -65,10 +65,8 @@ jobs:
- run: bundle exec rake
name: RSpec
working-directory: ${{ env.DECIDIM_MODULE }}
- uses: codecov/codecov-action@v1
with:
file: ./coverage/coverage.xml
name: ${{ env.DECIDIM_MODULE }}
- run: ./.github/upload_coverage.sh $DECIDIM_MODULE $GITHUB_EVENT_PATH
name: Upload coverage
- uses: actions/upload-artifact@v2-preview
if: always()
with:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/ci_pages.yml
Expand Up @@ -65,10 +65,8 @@ jobs:
- run: bundle exec rake
name: RSpec
working-directory: ${{ env.DECIDIM_MODULE }}
- uses: codecov/codecov-action@v1
with:
file: ./coverage/coverage.xml
name: ${{ env.DECIDIM_MODULE }}
- run: ./.github/upload_coverage.sh $DECIDIM_MODULE $GITHUB_EVENT_PATH
name: Upload coverage
- uses: actions/upload-artifact@v2-preview
if: always()
with:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/ci_participatory_processes.yml
Expand Up @@ -65,10 +65,8 @@ jobs:
- run: bundle exec rake
name: RSpec
working-directory: ${{ env.DECIDIM_MODULE }}
- uses: codecov/codecov-action@v1
with:
file: ./coverage/coverage.xml
name: ${{ env.DECIDIM_MODULE }}
- run: ./.github/upload_coverage.sh $DECIDIM_MODULE $GITHUB_EVENT_PATH
name: Upload coverage
- uses: actions/upload-artifact@v2-preview
if: always()
with:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/ci_proposals_system_admin.yml
Expand Up @@ -65,10 +65,8 @@ jobs:
- run: bundle exec rspec spec/system/admin
name: RSpec
working-directory: ${{ env.DECIDIM_MODULE }}
- uses: codecov/codecov-action@v1
with:
file: ./coverage/coverage.xml
name: decidim-proposals-system-admin
- run: ./.github/upload_coverage.sh decidim-proposals-system-admin $GITHUB_EVENT_PATH
name: Upload coverage
- uses: actions/upload-artifact@v2-preview
if: always()
with:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/ci_proposals_system_public.yml
Expand Up @@ -65,10 +65,8 @@ jobs:
- run: bundle exec rspec spec/system/ --exclude-pattern 'spec/system/admin/**/*_spec.rb'
name: RSpec
working-directory: ${{ env.DECIDIM_MODULE }}
- uses: codecov/codecov-action@v1
with:
file: ./coverage/coverage.xml
name: decidim-proposals-system-public
- run: ./.github/upload_coverage.sh decidim-proposals-system-public $GITHUB_EVENT_PATH
name: Upload coverage
- uses: actions/upload-artifact@v2-preview
if: always()
with:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/ci_proposals_unit_tests.yml
Expand Up @@ -65,10 +65,8 @@ jobs:
- run: bundle exec rspec --exclude-pattern 'spec/system/**/*_spec.rb'
name: RSpec
working-directory: ${{ env.DECIDIM_MODULE }}
- uses: codecov/codecov-action@v1
with:
file: ./coverage/coverage.xml
name: ${{ env.DECIDIM_MODULE }}
- run: ./.github/upload_coverage.sh $DECIDIM_MODULE $GITHUB_EVENT_PATH
name: Upload coverage
- uses: actions/upload-artifact@v2-preview
if: always()
with:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/ci_sortitions.yml
Expand Up @@ -65,10 +65,8 @@ jobs:
- run: bundle exec rake
name: RSpec
working-directory: ${{ env.DECIDIM_MODULE }}
- uses: codecov/codecov-action@v1
with:
file: ./coverage/coverage.xml
name: ${{ env.DECIDIM_MODULE }}
- run: ./.github/upload_coverage.sh $DECIDIM_MODULE $GITHUB_EVENT_PATH
name: Upload coverage
- uses: actions/upload-artifact@v2-preview
if: always()
with:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/ci_surveys.yml
Expand Up @@ -65,10 +65,8 @@ jobs:
- run: bundle exec rake
name: RSpec
working-directory: ${{ env.DECIDIM_MODULE }}
- uses: codecov/codecov-action@v1
with:
file: ./coverage/coverage.xml
name: ${{ env.DECIDIM_MODULE }}
- run: ./.github/upload_coverage.sh $DECIDIM_MODULE $GITHUB_EVENT_PATH
name: Upload coverage
- uses: actions/upload-artifact@v2-preview
if: always()
with:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/ci_system.yml
Expand Up @@ -65,10 +65,8 @@ jobs:
- run: bundle exec rake
name: RSpec
working-directory: ${{ env.DECIDIM_MODULE }}
- uses: codecov/codecov-action@v1
with:
file: ./coverage/coverage.xml
name: ${{ env.DECIDIM_MODULE }}
- run: ./.github/upload_coverage.sh $DECIDIM_MODULE $GITHUB_EVENT_PATH
name: Upload coverage
- uses: actions/upload-artifact@v2-preview
if: always()
with:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/ci_verifications.yml
Expand Up @@ -65,10 +65,8 @@ jobs:
- run: bundle exec rake
name: RSpec
working-directory: ${{ env.DECIDIM_MODULE }}
- uses: codecov/codecov-action@v1
with:
file: ./coverage/coverage.xml
name: ${{ env.DECIDIM_MODULE }}
- run: ./.github/upload_coverage.sh $DECIDIM_MODULE $GITHUB_EVENT_PATH
name: Upload coverage
- uses: actions/upload-artifact@v2-preview
if: always()
with:
Expand Down

0 comments on commit b5c8775

Please sign in to comment.