feat: create a GitHub release when publishing (#6) #52
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: Main | |
on: | |
push: | |
paths-ignore: | |
- 'docs/**' | |
branches: | |
- main | |
pull_request: | |
paths-ignore: | |
- 'docs/**' | |
branches: | |
- '**' | |
env: | |
default_python_version: "3.11" | |
jobs: | |
lint: | |
name: Static analysis | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.default_python_version }} | |
- name: Run pre-commit | |
uses: pre-commit/[email protected] | |
tests: | |
name: Tests (${{ matrix.os }} / Python ${{ matrix.python }}) | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python: ["3.9", "3.10", "3.11", "3.12"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Set up python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
- name: Install project dependencies | |
if: ${{ matrix.os == 'windows-latest' }} | |
run: C:\Users\runneradmin\.local\bin\poetry install | |
- name: Install project dependencies | |
if: ${{ matrix.os != 'windows-latest' }} | |
run: poetry install | |
- name: Run tests with coverage | |
if: ${{ matrix.os == 'windows-latest' }} | |
run: C:\Users\runneradmin\.local\bin\poetry run inv cover --report | |
- name: Run tests with coverage | |
if: ${{ matrix.os != 'windows-latest' }} | |
run: poetry run inv cover --report | |
- name: Send coverage results to Codecov | |
uses: codecov/[email protected] | |
with: | |
files: reports/coverage.xml | |
flags: unittests | |
name: Python ${{ matrix.python }} | |
# docs: | |
# name: Documentation | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - uses: actions/setup-python@v5 | |
# with: | |
# python-version: ${{ env.default_python_version }} | |
# - name: Install Poetry | |
# uses: snok/install-poetry@v1 | |
# - name: Install project dependencies | |
# run: poetry install --extras doc | |
# - name: Generate documentation | |
# run: poetry run inv doc | |
success: | |
name: Main Workflow Succeeded | |
runs-on: ubuntu-latest | |
# needs: [lint, tests, docs] | |
needs: [lint, tests] | |
steps: | |
- name: Empty job for easier merge condition | |
run: echo "✔ Success" |