Skip to content

Commit

Permalink
Move back to tokenless pr codecov with v5 fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Andre Kurait <[email protected]>
  • Loading branch information
AndreKurait committed Nov 21, 2024
1 parent d5b401c commit b9145a2
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 80 deletions.
51 changes: 29 additions & 22 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,6 @@ env:
node-version: '18.x'

jobs:
workflow-info:
runs-on: ubuntu-latest
steps:
- name: Create JSON Artifact
run: |
echo '{' > workflow-info.json
echo ' "pr_number": "${{ github.event.pull_request.number }}",' >> workflow-info.json
echo ' "commit": "${{ github.event.pull_request.head.sha || github.event.after || github.sha }}",' >> workflow-info.json
echo ' "branch": "${{ github.ref }}",' >> workflow-info.json
echo ' "commit_parent": "${{ github.event.pull_request.base.sha || github.event.before || github.base.sha }}",' >> workflow-info.json
echo ' "build_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",' >> workflow-info.json
echo ' "build": "${{ github.run_id }}"' >> workflow-info.json
echo '}' >> workflow-info.json
echo "workflow-info.json created"
- name: Upload JSON Artifact
uses: actions/upload-artifact@v4
with:
name: workflow-info
path: workflow-info.json


style-check:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -85,13 +64,19 @@ jobs:
- run: |
python3 -m pip install --upgrade pipenv
pipenv install --deploy --dev
pipenv run test
pipenv run test || TEST_FAILED=true
pipenv run coverage xml
if [ "$TEST_FAILED" = true ]; then
echo "Tests failed, exiting step with error"
exit 1
fi
- name: Get Sanitized Name
if: always()
env:
PY_PROJECT: ${{ matrix.py-project }}
run: echo "SANITIZED_PY_PROJECT=${PY_PROJECT/\//-}" >> $GITHUB_ENV
- name: Upload Coverage Reports
if: always()
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
Expand Down Expand Up @@ -129,6 +114,7 @@ jobs:
**/build/reports/tests/
**/reports/jacoco/mergedReport/
- name: Upload Coverage Reports
if: always()
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
Expand Down Expand Up @@ -235,6 +221,27 @@ jobs:
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

codecov-test:
needs:
- gradle-tests
- console-python-tests
- workflow-info
if: always()
runs-on: ubuntu-latest
steps:
- name: Download Coverage Artifacts
uses: actions/download-artifact@v4
with:
path: ./coverage-reports
pattern: coverage-reports-*
- name: Upload coverage report
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
files: /**/coverage-reports/**/*.*
flags: unittests
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true

all-ci-checks-pass:
needs:
Expand Down
58 changes: 0 additions & 58 deletions .github/workflows/codecov-publish.yml

This file was deleted.

0 comments on commit b9145a2

Please sign in to comment.