From 6a4cf3314fb712162e067c51434afbf67340c6b6 Mon Sep 17 00:00:00 2001 From: Sergey Zhuk Date: Tue, 19 Mar 2024 20:27:47 +0000 Subject: [PATCH] ci: PLT-268: add codecov upload --- .github/workflows/tests.yml | 74 ++++++++++++------------------------- .gitignore | 2 + codecov.yml | 2 + 3 files changed, 28 insertions(+), 50 deletions(-) create mode 100644 codecov.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6243ca87..72bbf8b4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -34,28 +34,28 @@ jobs: - name: Set up poetry uses: snok/install-poetry@v1 with: - python-version: '3.9' + python-version: '3.11' cache: true - name: Install Python dependencies - run: | - poetry install + run: poetry install - name: Run black - run: | - poetry run pytest --black . + run: poetry run pytest --black . - run_pytest_ubuntu: - name: Ubuntu - runs-on: ubuntu-latest + run_pytest: + name: Pytest ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - python-version: - - '3.8' - - '3.9' - - '3.10' - - '3.11' + include: + - os: ubuntu-latest + python-version: ['3.8', '3.9', '3.10', '3.11'] + test-command: poetry run pytest --junitxml report.xml --cov=. -vv + - os: windows-latest + python-version: ['3.8', '3.9', '3.10', '3.11'] + test-command: poetry run pytest -vv steps: - uses: actions/checkout@v4 @@ -63,46 +63,20 @@ jobs: - name: Set up poetry uses: snok/install-poetry@v1 with: - python-version: "${{ matrix.python-version }}" + python-version: ${{ matrix.python-version }} cache: true - name: Install Python dependencies - run: | - poetry install - - - name: Run functional tests - run: | - cd tests/ - poetry run pytest --junitxml report.xml --cov=. -vv + run: poetry install - run_pytests_windows: - name: Windows - runs-on: windows-latest - strategy: - fail-fast: false - matrix: - python-version: - - '3.8' - - '3.9' - - '3.10' - - '3.11' - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - ref: ${{ inputs.head_sha }} + - name: Run tests + working-directory: tests/ + run: ${{ matrix.test-command }} - - name: Set up poetry - uses: snok/install-poetry@v1 + - name: Upload to Codecov + if: matrix.os == 'ubuntu-latest && python-version == '3.11' + uses: codecov/codecov-action@v4.1.0 with: - python-version: "${{ matrix.python-version }}" - cache: true - - - name: Install Python dependencies - run: | - poetry install - - - name: Test with pytest - run: | - poetry run pytest -vv + files: tests/coverage.xml + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: true diff --git a/.gitignore b/.gitignore index 136fff0d..ac8954f5 100644 --- a/.gitignore +++ b/.gitignore @@ -171,3 +171,5 @@ pyrightconfig.json # actions-hub .github/actions-hub + +.idea/ \ No newline at end of file diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 00000000..1ab2dd97 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,2 @@ +fixes: + - "/home/runner/work/Adala/Adala/::" \ No newline at end of file