From 1a662545009f697461a94964e12cbcf7f1a6ca02 Mon Sep 17 00:00:00 2001 From: Pankaj Singh <98807258+pankajastro@users.noreply.github.com> Date: Wed, 7 Aug 2024 17:01:20 +0530 Subject: [PATCH] Add GH action CI job to enable CodeCov (#45) * Test CodeCov * Fix static check * Add code cov * Add code cov * Update anyscale_provider/operators/anyscale.py * Update .github/workflows/test.yml * Update .github/workflows/test.yml * Update .github/workflows/test.yml Co-authored-by: Pankaj Koti --------- Co-authored-by: Pankaj Koti --- .github/workflows/test.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4bb4d10..5c0e5d4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -111,3 +111,36 @@ jobs: with: name: coverage-integration-test-${{ matrix.python-version }}-${{ matrix.airflow-version }} path: .coverage + + Code-Coverage: + if: github.event.action != 'labeled' + needs: + - Run-Unit-Tests + - Run-Integration-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@v4 + with: + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} + files: coverage.xml