Update README.md #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Unit Tests | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: | ||
- "3.12" | ||
- "3.11" | ||
- "3.10" | ||
- "3.9" | ||
- "3.8" | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install Dependencies | ||
run: | | ||
python -m pip install -U pip | ||
python -m pip install -r requirements.txt | ||
- name: Install Coverage and Pytest | ||
run: | | ||
python -m pip install coverage | ||
python -m pip install pytest | ||
python -m pip install pytest-html | ||
- name: Create Coverage Directory | ||
run: mkdir -p coverage | ||
- name: Run Tests with Coverage | ||
run: | | ||
coverage run -m pytest --html=report.html | ||
- name: Run Tests and Collect Coverage | ||
run: | | ||
COVERAGE_FILE=coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }} | ||
CONTEXT=${{ runner.os }}-py${{ matrix.python-version }} | ||
coverage run -m pytest --html=report.html | ||
- name: Store Coverage Files | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: python-coverage-${{ matrix.python-version }} | ||
path: coverage | ||
- name: Store HTML Report | ||
if: always() | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: html-report | ||
path: report.html | ||
teste faile | ||