Skip to content

Commit

Permalink
Tidying workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
andylockran committed Jan 28, 2024
1 parent 992e45e commit e09a1b8
Show file tree
Hide file tree
Showing 4 changed files with 263 additions and 12 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9"] #, "3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v3
Expand All @@ -27,14 +27,14 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest pytest-cov mock
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python -m pip install poetry
poetry install --with test
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=12 --max-line-length=127 --statistics
poetry run flake8 . --count --exit-zero --max-complexity=12 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
poetry run pytest
10 changes: 5 additions & 5 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
python -m pip install poetry
poetry install
- name: Build package
run: poetry build
- name: Set poetry creds
run: poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
run: poetry publish
247 changes: 246 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ pyserial-asyncio = "^0.6"
pyyaml = "^6.0.1"


[tool.poetry.group.test.dependencies]
flake8 = "^7.0.0"
pytest = "^8.0.0"
pytest-cov = "^4.1.0"
mock = "^5.1.0"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

0 comments on commit e09a1b8

Please sign in to comment.