Skip to content

Commit

Permalink
Update pytest.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
sachin-apa authored Jan 23, 2025
1 parent 207a571 commit cb942f4
Showing 1 changed file with 22 additions and 9 deletions.
31 changes: 22 additions & 9 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -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:
- collections
pull_request:
# Runs CI on every day (at 06:00 UTC)
schedule:
- cron: '0 6 * * *'

jobs:
build:
Expand All @@ -10,19 +23,19 @@ 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:
python-version: ${{ matrix.python-version }}
- 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 PyPowerStore/tests/unit_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

0 comments on commit cb942f4

Please sign in to comment.