PyBreeze Dev #178
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: PyBreeze Dev | |
| on: | |
| push: | |
| branches: [ "dev" ] | |
| pull_request: | |
| branches: [ "dev" ] | |
| schedule: | |
| - cron: "0 2 * * *" | |
| permissions: | |
| contents: read | |
| jobs: | |
| unit-tests: | |
| runs-on: windows-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Update pip wheel setuptools | |
| run: python -m pip install --upgrade pip setuptools wheel | |
| - name: Install dev dependencies | |
| run: python -m pip install -r dev_requirements.txt | |
| - name: Install test tooling | |
| run: python -m pip install pytest pytest-cov hypothesis | |
| - name: Run unit tests (pytest) | |
| run: python -m pytest test/test_utils/ -v --tb=short --cov=pybreeze --cov-branch --cov-report=xml | |
| - name: Upload coverage for analysis | |
| # One leg is enough; the scanner only consumes a single report. | |
| if: matrix.python-version == '3.12' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-xml | |
| path: coverage.xml | |
| if-no-files-found: error | |
| - name: Run AutomationEditor With Debug Mode | |
| run: python ./test/unit_test/start_automation/start_automation_test.py | |
| env: | |
| PYTHONPATH: . | |
| - name: Extend AutomationEditor | |
| run: python ./test/unit_test/start_automation/extend_automation_test.py | |
| env: | |
| PYTHONPATH: . | |
| sonarcloud: | |
| # Pull requests only. SonarCloud's plan for this organization exposes results | |
| # for the main branch and for pull requests; an analysis pushed for `dev` | |
| # succeeds but its results are not readable, so scanning every push here | |
| # would spend CI time on numbers nobody can see. Fork pull requests are | |
| # skipped because they cannot read the token. | |
| if: >- | |
| github.event_name == 'pull_request' && | |
| github.event.pull_request.head.repo.full_name == github.repository | |
| needs: unit-tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| # Sonar needs the full history to attribute new code to the right commits. | |
| fetch-depth: 0 | |
| - name: Download coverage | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: coverage-xml | |
| - name: Read package version | |
| # Without a version, SonarCloud's "previous version" new-code baseline has | |
| # nothing to anchor to and counts the whole history as new -- which is how | |
| # new_lines came to exceed the project's total line count. | |
| id: version | |
| run: echo "value=$(grep -m1 '^version = ' pyproject.toml | cut -d'"' -f2)" >> "$GITHUB_OUTPUT" | |
| - name: SonarQube Cloud scan | |
| uses: SonarSource/sonarqube-scan-action@v8.2.1 | |
| with: | |
| args: -Dsonar.projectVersion=${{ steps.version.outputs.value }} | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| SONAR_HOST_URL: https://sonarcloud.io |