From 7722fffd2ae50508bac96f46b92e5b084e4b919a Mon Sep 17 00:00:00 2001 From: Sachin Apagundi <62133262+sachin-apa@users.noreply.github.com> Date: Thu, 23 Jan 2025 11:22:57 +0530 Subject: [PATCH 1/4] Update pytest.yml --- .github/workflows/pytest.yml | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index faed19e..5cbd115 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -1,6 +1,19 @@ name: Run Unit Test via Pytest -on: [push] +concurrency: + group: ${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +on: + # Run CI against all pushes (direct commits, also merged PRs), Pull Requests + workflow_dispatch: + push: + branches: + - main + pull_request: + # Runs CI on every day (at 06:00 UTC) + schedule: + - cron: '0 6 * * *' jobs: build: @@ -10,7 +23,8 @@ jobs: python-version: ['3.9', '3.10', '3.11', '3.12'] steps: - - uses: actions/checkout@v3 + - name: Check out the code + uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: @@ -18,11 +32,13 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install testtools - pip install requests - pip install pytest - pip install pytest-coverage + pip install testtools requests pytest pytest-coverage coverage if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Test with pytest - run: | - python -m unittest -v tests/test_*.py + - name: Run Unit Test and Generate report + run: | + coverage run -m pytest -v PyPowerStore/tests/unit_tests/test_*.py + - name: Upload Coverage to Codecov + uses: codecov/codecov-action@v5 + if: ${{ matrix.python-version == '3.12' }} + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From 84188190da2d13b9bf5b1322c7a66f39700669f8 Mon Sep 17 00:00:00 2001 From: Sachin Apagundi <62133262+sachin-apa@users.noreply.github.com> Date: Thu, 23 Jan 2025 11:26:33 +0530 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 5cbd115..41cb828 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -36,7 +36,7 @@ jobs: if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Run Unit Test and Generate report run: | - coverage run -m pytest -v PyPowerStore/tests/unit_tests/test_*.py + coverage run -m pytest -v PyPowerFlex/tests/unit_tests/test_*.py - name: Upload Coverage to Codecov uses: codecov/codecov-action@v5 if: ${{ matrix.python-version == '3.12' }} From f487808a4eb31d7a0d1f0ce136ae76aa5d6f499f Mon Sep 17 00:00:00 2001 From: Sachin Apagundi <62133262+sachin-apa@users.noreply.github.com> Date: Thu, 23 Jan 2025 11:27:30 +0530 Subject: [PATCH 3/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 41cb828..38cee2a 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -36,7 +36,7 @@ jobs: if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Run Unit Test and Generate report run: | - coverage run -m pytest -v PyPowerFlex/tests/unit_tests/test_*.py + coverage run -m pytest -v PyPowerFlex/tests/test_*.py - name: Upload Coverage to Codecov uses: codecov/codecov-action@v5 if: ${{ matrix.python-version == '3.12' }} From 455ea3d4a0204efed112dd1ac0ec8f84f757422c Mon Sep 17 00:00:00 2001 From: Sachin Apagundi <62133262+sachin-apa@users.noreply.github.com> Date: Thu, 23 Jan 2025 11:30:21 +0530 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 38cee2a..56dd618 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -36,7 +36,7 @@ jobs: if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Run Unit Test and Generate report run: | - coverage run -m pytest -v PyPowerFlex/tests/test_*.py + coverage run -m pytest -v tests/test_*.py - name: Upload Coverage to Codecov uses: codecov/codecov-action@v5 if: ${{ matrix.python-version == '3.12' }}