Skip to content

Commit

Permalink
Rearrange workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
bswck committed Aug 17, 2023
1 parent fc208bd commit 786ba15
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 55 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/ci.yml → .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: Lint (black --check, pylint, ruff)

on: [push]

Expand All @@ -17,10 +17,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Type-check with mypy
run: >-
mypy configzen/ --strict || (echo y | mypy --install-types && mypy configzen/ --strict)
pip install $(cat requirements-dev.txt | grep -oiP "(pylint|black|ruff)\\s?==\\s?(([0-9]+\\.){2}[0-9]+)")
- name: Check with black
run: >-
black --check configzen/
Expand All @@ -30,6 +27,3 @@ jobs:
- name: Analyse the code with ruff
run: >-
ruff configzen/
- name: Run tests
run: >-
export PYTHONPATH=. && pytest -v tests/
23 changes: 23 additions & 0 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Static type check (mypy)

on: [push]

jobs:
ci:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "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 dependencies
run: |
python -m pip install --upgrade pip
pip install $(cat requirements-dev.txt | grep -oiP "\\s?==\\s?(([0-9]+\\.){2}[0-9]+)")
- name: Type-check with mypy
run: >-
mypy configzen/ --strict || (echo yes | mypy --install-types && mypy configzen/ --strict)
47 changes: 0 additions & 47 deletions .github/workflows/publish.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Publish to PyPI (via Trusted Publisher, poetry)

on: [push]
# release:
# types: [published]

jobs:
deploy:
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
env:
POETRY_VIRTUALENVS_CREATE: "false"
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: |
pipx install poetry
pipx inject poetry poetry-bumpversion
- name: Build with poetry
run: |
poetry version ${{ github.ref_name }}
poetry build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
26 changes: 26 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Tests & coverage

on: [push]

jobs:
ci:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "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 dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Run tests
run: >-
coverage run -m pytest -v tests/
- name: Check coverage
run: >-
coverage report --fail-under=50 -m

0 comments on commit 786ba15

Please sign in to comment.