Skip to content

chore: internal design #146

chore: internal design

chore: internal design #146

Workflow file for this run

# Basic workflow for building and testing the pip installation
name: CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab
jobs:
Quality:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', 3.11]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install Python poetry
uses: abatilo/actions-poetry@v2.1.0
with:
poetry-version: 1.5.1
- name: Configure poetry
shell: bash
run: python -m poetry config virtualenvs.in-project true
- name: View poetry version
run: poetry --version
- name: Install dependencies
run: |
python -m poetry install
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
python -m poetry run flake8 . --exclude .venv --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
python -m poetry run flake8 . --exclude .venv --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
python -m poetry run coverage run -m pytest
python -m poetry run coverage report -m
python -m poetry run coverage xml
- name: Upload coverage report
uses: codecov/codecov-action@v3
with:
files: ./coverage.xml
Release:
needs: Quality
# https://github.community/t/how-do-i-specify-job-dependency-running-in-another-workflow/16482
# if: github.event_name == 'push' && github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, 'chore(release):')
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
concurrency: release
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
# This action uses Python Semantic Release v8
- name: Python semantic release
id: release
uses: python-semantic-release/python-semantic-release@v8.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
# NOTE: DO NOT wrap the conditional in ${{ }} as it will always evaluate to true.
# See https://github.com/actions/runner/issues/1173
if: steps.release.outputs.released == 'true'
- name: Publish package distributions to GitHub Releases
uses: python-semantic-release/upload-to-gh-release@main
if: steps.release.outputs.released == 'true'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}