Merge remote-tracking branch 'origin/new-results-libs' into new-results #267
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: Python package | |
on: [push] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 5 | |
matrix: | |
python-version: [3.11, '3.10', 3.9, 3.8, 3.7] | |
changed-dir: ["qaseio", "qase-pytest", "qase-robotframework", "qase-python-commons"] | |
name: Project ${{ matrix.changed-dir }} - Python ${{ matrix.python-version }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dorny/paths-filter@v2 | |
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@v1 | |
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 | |
- name: Lint with tox | |
if: steps.filter.outputs.changes == 'true' | |
working-directory: ./${{ matrix.changed-dir }} | |
run: | | |
tox | |
build-n-publish: | |
runs-on: ubuntu-latest | |
needs: test | |
strategy: | |
max-parallel: 1 | |
matrix: | |
prefix: [ "qaseio", "qase-pytest", "qase-robotframework", "qase-python-commons" ] | |
if: startsWith(github.event.ref, 'refs/tags') | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.9 | |
if: contains(github.event.ref, matrix.prefix) | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.9 | |
- name: Build a binary wheel and a source tarball | |
if: contains(github.event.ref, matrix.prefix) | |
working-directory: ./${{ matrix.prefix }} | |
run: | | |
pip install wheel | |
python setup.py sdist bdist_wheel | |
- name: Publish distribution to PyPI | |
if: contains(github.event.ref, matrix.prefix) | |
uses: pypa/[email protected] | |
with: | |
password: ${{ secrets.PYPI_PASSWORD }} | |
packages_dir: ./${{ matrix.prefix }}/dist |