From 1757b437b707275b27bd3fca1d1fce23d81b6fde Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 8 May 2024 21:56:48 +0300 Subject: [PATCH 1/4] Create pytest.yml --- .github/workflows/pytest.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/pytest.yml diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml new file mode 100644 index 0000000..c7c395d --- /dev/null +++ b/.github/workflows/pytest.yml @@ -0,0 +1,19 @@ +name: PyTest with coverage + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + name: Test python API + steps: + - uses: actions/checkout@v4 + - name: Install requirements + run: pip install . + - name: Run tests and collect coverage + run: pytest --cov . + - name: Upload coverage reports to Codecov + run: | + curl -Os https://cli.codecov.io/latest/linux/codecov + chmod +x codecov + ./codecov --verbose upload-process --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} -n 'service'-${{ github.run_id }} -F service -f coverage-service.xml From 5d63675aabd1685b7d5e1df3680454a6f81f0030 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 8 May 2024 21:58:44 +0300 Subject: [PATCH 2/4] Update pytest.yml --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index c7c395d..3745f3d 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -9,7 +9,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Install requirements - run: pip install . + run: pip install .[test] - name: Run tests and collect coverage run: pytest --cov . - name: Upload coverage reports to Codecov From e226bfd8ed1fc46675a0a5b4ada27beeebe0ebf6 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 8 May 2024 22:11:29 +0300 Subject: [PATCH 3/4] Update pytest.yml --- .github/workflows/pytest.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 3745f3d..57fe3d9 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -8,8 +8,15 @@ jobs: name: Test python API steps: - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: "3.10" + - name: Run image + uses: abatilo/actions-poetry@v2 + with: + poetry-version: "1.7.1" - name: Install requirements - run: pip install .[test] + run: poetry install - name: Run tests and collect coverage run: pytest --cov . - name: Upload coverage reports to Codecov From 93409eb5154a62f5039c63d0f2479e53a935441f Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 8 May 2024 22:13:03 +0300 Subject: [PATCH 4/4] Update pytest.yml --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 57fe3d9..c24aba9 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -18,7 +18,7 @@ jobs: - name: Install requirements run: poetry install - name: Run tests and collect coverage - run: pytest --cov . + run: poetry run pytest --cov . - name: Upload coverage reports to Codecov run: | curl -Os https://cli.codecov.io/latest/linux/codecov