Merge pull request #477 from qase-tms/feat/reporters-tags-support #1292
Workflow file for this run
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: Python package | |
| on: [ push ] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| fail-fast: false | |
| max-parallel: 5 | |
| matrix: | |
| python-version: | |
| - "3.13" | |
| - "3.12" | |
| - "3.11" | |
| - "3.10" | |
| - "3.9" | |
| changed-dir: | |
| - "qase-api-client" | |
| - "qase-api-v2-client" | |
| - "qase-pytest" | |
| - "qase-robotframework" | |
| - "qase-python-commons" | |
| - "qase-behave" | |
| - "qase-tavern" | |
| name: Project ${{ matrix.changed-dir }} - Python ${{ matrix.python-version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| list-files: "shell" | |
| filters: | | |
| changes: | |
| - '${{ matrix.changed-dir }}/**' | |
| - name: Set up Python ${{ matrix.python-version }} | |
| if: steps.filter.outputs.changes == 'true' | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| if: steps.filter.outputs.changes == 'true' | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install tox tox-gh-actions | |
| - name: Run tox | |
| if: steps.filter.outputs.changes == 'true' | |
| working-directory: ./${{ matrix.changed-dir }} | |
| run: | | |
| tox | |
| integration-test: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install reporters-validator | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install git+https://github.com/qase-tms/reporters-validator.git | |
| - name: Download report schemas | |
| run: git clone --depth 1 https://github.com/qase-tms/specs.git /tmp/specs | |
| - name: Validate Pytest reporter | |
| run: | | |
| python -m venv /tmp/venv-pytest | |
| /tmp/venv-pytest/bin/pip install -q \ | |
| ./qase-api-client ./qase-api-v2-client ./qase-python-commons ./qase-pytest | |
| QASE_MODE=report \ | |
| QASE_REPORT_CONNECTION_PATH=${{ github.workspace }}/build/pytest-report \ | |
| /tmp/venv-pytest/bin/python -m pytest integration/pytest/tests/ -v || true | |
| reporters-validator validate \ | |
| --report-dir ${{ github.workspace }}/build/pytest-report \ | |
| --expected integration/pytest/expected/pytest-examples.yaml \ | |
| --schema-dir /tmp/specs/report/schemas | |
| - name: Validate Behave reporter | |
| run: | | |
| python -m venv /tmp/venv-behave | |
| /tmp/venv-behave/bin/pip install -q \ | |
| ./qase-api-client ./qase-api-v2-client ./qase-python-commons ./qase-behave | |
| cd integration/behave | |
| QASE_MODE=report \ | |
| QASE_REPORT_CONNECTION_PATH=${{ github.workspace }}/build/behave-report \ | |
| /tmp/venv-behave/bin/behave --format=qase.behave.formatter:QaseFormatter --no-capture features/ || true | |
| reporters-validator validate \ | |
| --report-dir ${{ github.workspace }}/build/behave-report \ | |
| --expected expected/behave-examples.yaml \ | |
| --schema-dir /tmp/specs/report/schemas | |
| - name: Validate Robot Framework reporter | |
| run: | | |
| python -m venv /tmp/venv-robot | |
| /tmp/venv-robot/bin/pip install -q \ | |
| ./qase-api-client ./qase-api-v2-client ./qase-python-commons ./qase-robotframework \ | |
| robotframework | |
| QASE_MODE=report \ | |
| QASE_REPORT_CONNECTION_PATH=${{ github.workspace }}/build/robot-report \ | |
| /tmp/venv-robot/bin/robot --listener qase.robotframework.Listener \ | |
| --outputdir /tmp/robot-output \ | |
| integration/robot/tests/ || true | |
| reporters-validator validate \ | |
| --report-dir ${{ github.workspace }}/build/robot-report \ | |
| --expected integration/robot/expected/robot-examples.yaml \ | |
| --schema-dir /tmp/specs/report/schemas | |
| - name: Validate Tavern reporter | |
| run: | | |
| python -m venv /tmp/venv-tavern | |
| /tmp/venv-tavern/bin/pip install -q \ | |
| ./qase-api-client ./qase-api-v2-client ./qase-python-commons ./qase-tavern \ | |
| tavern | |
| QASE_MODE=report \ | |
| QASE_REPORT_CONNECTION_PATH=${{ github.workspace }}/build/tavern-report \ | |
| /tmp/venv-tavern/bin/python -m pytest integration/tavern/tests/ -v || true | |
| reporters-validator validate \ | |
| --report-dir ${{ github.workspace }}/build/tavern-report \ | |
| --expected integration/tavern/expected/tavern-examples.yaml \ | |
| --schema-dir /tmp/specs/report/schemas | |
| build-n-publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| needs: test | |
| strategy: | |
| max-parallel: 1 | |
| matrix: | |
| prefix: | |
| [ | |
| "qase-api-client", | |
| "qase-api-v2-client", | |
| "qase-pytest", | |
| "qase-robotframework", | |
| "qase-python-commons", | |
| "qase-behave", | |
| "qase-tavern" | |
| ] | |
| if: startsWith(github.event.ref, 'refs/tags') | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.9 | |
| if: contains(github.event.ref, matrix.prefix) | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.9 | |
| - name: Install build dependencies | |
| if: contains(github.event.ref, matrix.prefix) | |
| run: | | |
| python -m pip install --upgrade pip setuptools wheel build | |
| - name: Build the package | |
| if: contains(github.event.ref, matrix.prefix) | |
| working-directory: ./${{ matrix.prefix }} | |
| run: | | |
| python -m build | |
| - name: Publish distribution to PyPI | |
| if: contains(github.event.ref, matrix.prefix) | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.PYPI_PASSWORD }} | |
| packages-dir: ./${{ matrix.prefix }}/dist | |
| - name: Extract tag name | |
| if: contains(github.event.ref, matrix.prefix) | |
| id: tag | |
| run: | | |
| TAG_NAME=${GITHUB_REF#refs/tags/} | |
| echo "tag=$TAG_NAME" >> $GITHUB_OUTPUT | |
| - name: Create GitHub Release | |
| if: contains(github.event.ref, matrix.prefix) | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.tag.outputs.tag }} | |
| name: Release ${{ steps.tag.outputs.tag }} | |
| generate_release_notes: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |