Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): use Poetry #398

Merged
merged 17 commits into from
Sep 23, 2024
Merged
4 changes: 0 additions & 4 deletions .flake8

This file was deleted.

58 changes: 0 additions & 58 deletions .github/workflows/build.yml

This file was deleted.

58 changes: 42 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,52 @@
name: Upload Python Package
name: Release

# yamllint disable-line rule:truthy
on:
release:
types: [published]
types:
- published

env:
DEFAULT_PYTHON: "3.11"

jobs:
deploy:
release:
name: Releasing to PyPI
runs-on: ubuntu-latest
environment:
name: PyPI
url: https://pypi.org/p/PyViCare
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
- name: ⤵️ Check out code from GitHub
uses: actions/[email protected]
- name: 🏗 Set up Poetry
run: pipx install poetry
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/[email protected]
with:
python-version: "3.x"
- name: Install dependencies
python-version: ${{ env.DEFAULT_PYTHON }}
cache: "poetry"
- name: 🏗 Install workflow dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_APITOKEN }}
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: 🏗 Install dependencies
run: poetry install --no-interaction
- name: 🏗 Set package version
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
version="${{ github.event.release.tag_name }}"
version="${version,,}"
version="${version#v}"
poetry version --no-interaction "${version}"
- name: 🏗 Build package
run: poetry build --no-interaction
- name: 🚀 Publish to PyPi
uses: pypa/[email protected]
with:
verbose: true
print-hash: true
password: ${{ secrets.PYPI_APITOKEN }}
45 changes: 45 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Test

# yamllint disable-line rule:truthy
on:
push:
branches:
- main
- master
pull_request:
workflow_dispatch:

env:
DEFAULT_PYTHON: "3.11"

jobs:
pytest:
name: Python ${{ matrix.python }}
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/[email protected]
- name: 🏗 Set up Poetry
run: pipx install poetry
- name: 🏗 Set up Python ${{ matrix.python }}
id: python
uses: actions/[email protected]
with:
python-version: ${{ matrix.python }}
cache: "poetry"
- name: 🏗 Install workflow dependencies
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: 🏗 Install dependencies
run: poetry install --no-interaction
- name: 🚀 Run pytest
run: poetry run pytest --cov PyViCare
- name: ⬆️ Upload coverage artifact
uses: actions/[email protected]
with:
name: coverage-${{ matrix.python }}
path: .coverage
20 changes: 0 additions & 20 deletions Makefile

This file was deleted.

Loading
Loading