Skip to content

Workflow file for this run

name: Continuous Integration
on: [push, pull_request]
defaults:
run:
shell: bash
concurrency:
group: ci-tests-${{ github.ref }}-1
cancel-in-progress: true
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, windows-2019]
python-version: ["3.8", "3.9", "3.10", "3.11"]
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up python
id: setup-python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Print Python Information
run: python -VV
- name: Install and configure Poetry
run: |
pip3 install poetry
poetry config virtualenvs.in-project true
- name: Set up cache
uses: actions/cache@v3
id: cached-poetry-dependencies
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: poetry install --with dev
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
- name: Download TeamTalk SDK
run: poetry run python -c "import teamtalk"
- name: run linting
run: poetry run pre-commit run --all-files
builder_teamtalk:
needs: [test]
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-20.04 # Any OS is fine as this wheel is not OS dependent
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up python
id: setup-python
uses: actions/setup-python@v4
with:
python-version: 3.9 # Build any 1 python version as this wheel is not version dependent
- name: Install and configure Poetry
run: |
pip3 install poetry
poetry config virtualenvs.in-project true
- name: Set up cache
uses: actions/cache@v3
id: cached-poetry-dependencies
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: poetry install
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
- name: Build
run: poetry build
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/
publisher_release:
needs: [builder_teamtalk]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}