pip(deps-dev): update pytest requirement from ^8.3.5 to ^9.0.1 #15
This file contains hidden or 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: Continuous Integration | |
| on: | |
| push: | |
| branches: [main, master, develop] | |
| pull_request: | |
| branches: [main, master] | |
| workflow_dispatch: | |
| jobs: | |
| lint: | |
| name: Lint Code | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| cache: 'pip' | |
| - name: Install dependencies | |
| shell: pwsh | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install flake8 black isort | |
| if (Test-Path -Path "requirements.txt") { | |
| pip install -r requirements.txt | |
| } | |
| - name: Lint with flake8 | |
| shell: pwsh | |
| run: | | |
| # stop the build if there are Python syntax errors or undefined names | |
| flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
| # exit-zero treats all errors as warnings | |
| flake8 . --count --exit-zero --max-complexity=10 --max-line-length=120 --statistics | |
| - name: Check formatting with black | |
| run: black --check . | |
| test: | |
| name: Run Tests | |
| runs-on: windows-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.10', '3.11', '3.12'] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: 'pip' | |
| - name: Install Poetry | |
| shell: pwsh | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install poetry | |
| - name: Install dependencies with Poetry | |
| shell: pwsh | |
| run: | | |
| poetry config virtualenvs.create true | |
| poetry install | |
| - name: Test with pytest | |
| shell: pwsh | |
| env: | |
| DISPLAY: ':99.0' | |
| CI: 'true' | |
| run: | | |
| # Create test directory if it doesn't exist | |
| if (-Not (Test-Path -Path "tests")) { | |
| New-Item -Path "tests" -ItemType Directory | |
| } | |
| if (-Not (Test-Path -Path "tests/__init__.py")) { | |
| New-Item -Path "tests/__init__.py" -ItemType File | |
| } | |
| # Run tests using Poetry | |
| poetry run pytest --cov=src tests/ --cov-report=xml | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| file: ./coverage.xml | |
| fail_ci_if_error: false |