Skip to content

Commit

Permalink
Report coverage to Codacy for behave tests (patroni#2518)
Browse files Browse the repository at this point in the history
  • Loading branch information
hughcapet authored Jan 11, 2023
1 parent c12fe41 commit 9de22e6
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,25 +143,29 @@ jobs:
features/output/*
if-no-files-found: error
retention-days: 5
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install coveralls
run: python -m pip install coveralls
- name: Upload Coverage
- name: Generate coverage xml report
run: python -m coverage xml -o cobertura.xml
- name: Upload coverage to Codacy
run: bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r cobertura.xml -l Python --partial
env:
COVERALLS_FLAG_NAME: behave-${{ matrix.os }}-${{ matrix.dcs }}-${{ matrix.python-version }}
COVERALLS_PARALLEL: 'true'
GITHUB_TOKEN: ${{ secrets.github_token }}
run: python -m coveralls --service=github
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}

coveralls-finish:
name: Finalize coveralls.io
needs: [unit, behave]
needs: unit
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v4
- run: python -m pip install coveralls
- run: python -m coveralls --service=github --finish
env:
GITHUB_TOKEN: ${{ secrets.github_token }}

codacy-final:
name: Finalize Codacy
needs: behave
runs-on: ubuntu-latest
steps:
- run: bash <(curl -Ls https://coverage.codacy.com/get.sh) final
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}

0 comments on commit 9de22e6

Please sign in to comment.