From 03b72c3c929445b979560e5a2d730a83c0ba35d5 Mon Sep 17 00:00:00 2001 From: Daniyar Auezkhan <57720347+bl1nkker@users.noreply.github.com> Date: Tue, 4 Apr 2023 07:20:21 +0600 Subject: [PATCH] fix: added codecov to ci and made linter happy :) (#335) Signed-off-by: bl1nkker --- .github/workflows/ci.yml | 18 +++++++++++------- test_opensearchpy/run_tests.py | 6 +++++- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c3402066..7bda4f88 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,20 +34,19 @@ jobs: - name: Build project for distribution run: | python3.7 -m build - test-linux: strategy: fail-fast: false matrix: - python-version: ['2.7', '3.7', '3.8', '3.9', '3.10', '3.11'] + python-version: ["2.7", "3.7", "3.8", "3.9", "3.10", "3.11"] os: [ubuntu-latest] experimental: [false] include: - - os: 'ubuntu-20.04' - python-version: '3.5' + - os: "ubuntu-20.04" + python-version: "3.5" experimental: false - - os: 'ubuntu-20.04' - python-version: '3.6' + - os: "ubuntu-20.04" + python-version: "3.6" experimental: false runs-on: ${{ matrix.os }} @@ -69,6 +68,11 @@ jobs: - name: Run Tests run: | python setup.py test + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v2 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./junit/opensearch-py-codecov.xml twine-check: runs-on: ubuntu-latest @@ -77,7 +81,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.x' + python-version: "3.x" - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/test_opensearchpy/run_tests.py b/test_opensearchpy/run_tests.py index aba69650..26375885 100755 --- a/test_opensearchpy/run_tests.py +++ b/test_opensearchpy/run_tests.py @@ -94,13 +94,17 @@ def run_all(argv=None): junit_xml = join( abspath(dirname(dirname(__file__))), "junit", "opensearch-py-junit.xml" ) + codecov_xml = join( + abspath(dirname(dirname(__file__))), "junit", "opensearch-py-codecov.xml" + ) argv = [ "pytest", - "--cov=opensearch", + "--cov=opensearchpy", "--junitxml=%s" % junit_xml, "--log-level=DEBUG", "--cache-clear", "-vv", + "--cov-report=xml:%s" % codecov_xml, ] secured = False