diff --git a/.github/workflows/server-mariadb-tests.yml b/.github/workflows/server-mariadb-tests.yml index fb6e56037c..57a7fa304d 100644 --- a/.github/workflows/server-mariadb-tests.yml +++ b/.github/workflows/server-mariadb-tests.yml @@ -120,49 +120,10 @@ jobs: CI_BUILD_ID: ${{ github.run_id }} ORCHESTRATOR_URL: http://test-orchestrator.frappe.io - - name: Upload Coverage Data - if: ${{ steps.check-build.outputs.build == 'strawberry' }} - id: upload-coverage-data - run: | - cp ~/frappe-bench/sites/.coverage ${GITHUB_WORKSPACE} - cd ${GITHUB_WORKSPACE} - pip3 install coverage==5.5 - pip3 install coveralls==3.0.1 - coveralls - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }} - COVERALLS_FLAG_NAME: run-${{ matrix.container }} - COVERALLS_SERVICE_NAME: ${{ github.event_name == 'pull_request' && 'github' || 'github-actions' }} - COVERALLS_PARALLEL: true - - - run: echo ${{ steps.check-build.outputs.build }} > guess-the-fruit.txt - - uses: actions/upload-artifact@v1 + - name: Upload coverage data + uses: codecov/codecov-action@v2 with: - name: fruit - path: guess-the-fruit.txt - - coveralls: - name: Coverage Wrap Up - needs: test - container: python:3-slim - runs-on: ubuntu-18.04 - steps: - - uses: actions/download-artifact@v1 - with: - name: fruit - - run: echo "WILDCARD=$(cat fruit/guess-the-fruit.txt)" >> $GITHUB_ENV - - - name: Clone - if: ${{ env.WILDCARD == 'strawberry' }} - uses: actions/checkout@v2 - - - name: Coveralls Finished - if: ${{ env.WILDCARD == 'strawberry' }} - run: | - cd ${GITHUB_WORKSPACE} - pip3 install coverage==5.5 - pip3 install coveralls==3.0.1 - coveralls --finish - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + name: MariaDB + fail_ci_if_error: true + files: /home/runner/frappe-bench/sites/coverage.xml + verbose: true diff --git a/.github/workflows/server-postgres-tests.yml b/.github/workflows/server-postgres-tests.yml index 1539e8c2d5..fe33a9c917 100644 --- a/.github/workflows/server-postgres-tests.yml +++ b/.github/workflows/server-postgres-tests.yml @@ -116,7 +116,15 @@ jobs: - name: Run Tests if: ${{ steps.check-build.outputs.build == 'strawberry' }} - run: cd ~/frappe-bench/ && bench --site test_site run-parallel-tests --use-orchestrator + run: cd ~/frappe-bench/ && bench --site test_site run-parallel-tests --use-orchestrator --with-coverage env: CI_BUILD_ID: ${{ github.run_id }} ORCHESTRATOR_URL: http://test-orchestrator.frappe.io + + - name: Upload coverage data + uses: codecov/codecov-action@v2 + with: + name: Postgres + fail_ci_if_error: true + files: /home/runner/frappe-bench/sites/coverage.xml + verbose: true diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000000..00e85225f4 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,5 @@ +codecov: + require_ci_to_pass: yes +comment: + layout: "diff, flags, files" + require_changes: true \ No newline at end of file diff --git a/frappe/coverage.py b/frappe/coverage.py index 33f945be40..1969cae141 100644 --- a/frappe/coverage.py +++ b/frappe/coverage.py @@ -58,4 +58,5 @@ class CodeCoverage(): def __exit__(self, exc_type, exc_value, traceback): if self.with_coverage: self.coverage.stop() - self.coverage.save() \ No newline at end of file + self.coverage.save() + self.coverage.xml_report() \ No newline at end of file