diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7f16eb3..1c4c442 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,9 +2,9 @@ name: test on: push: - branches: [ "main" ] + branches: [ "main", "codecov" ] pull_request: - branches: [ "main" ] + branches: [ "main", "codecov" ] concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} @@ -72,3 +72,35 @@ jobs: with: name: coverage-unit-test-${{ matrix.python-version }}-${{ matrix.airflow-version }} path: .coverage + + Code-Coverage: + if: github.event.action != 'labeled' + needs: + - Run-Unit-Tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha || github.ref }} + - name: Set up Python 3.11 + uses: actions/setup-python@v3 + with: + python-version: "3.11" + - name: Install coverage + run: | + pip3 install coverage + - name: Download all coverage artifacts + uses: actions/download-artifact@v2 + with: + path: ./coverage + - name: Combine coverage + run: | + coverage combine ./coverage/coverage*/.coverage + coverage report + coverage xml + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} + files: coverage.xml