Skip to content

Commit

Permalink
add ci and update deps (#3)
Browse files Browse the repository at this point in the history
* add ci and update deps

* fix ci trigger
  • Loading branch information
lesnik512 authored Apr 29, 2024
1 parent ae8e811 commit 1f6307a
Show file tree
Hide file tree
Showing 3 changed files with 257 additions and 188 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: main

on:
push:
branches:
- main
pull_request: {}

concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- uses: arduino/setup-task@v1
with:
repo-token: ${{ github.token }}
- run: pip install poetry
- run: task install
- run: task lint-ci

pytest:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: arduino/setup-task@v1
with:
repo-token: ${{ github.token }}
- run: pip install poetry
- run: task install
- run: task tests
22 changes: 22 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,29 @@ tasks:
- poetry run ruff check . --fix
- poetry run mypy .

lint-ci:
desc: "run linters"
cmds:
- poetry run ruff format . --check
- poetry run ruff check . --no-fix
- poetry run mypy .

tests:
desc: "run pytest (pass args after '--')"
cmds:
- poetry run pytest {{.CLI_ARGS}}

release:
desc: "bump version, create tag and release, publish to PYPI"
cmds:
- rm -rf ./dist
- poetry version {{.CLI_ARGS}}
- git add pyproject.toml
- git commit -m "bump version to {{.CLI_ARGS}}"
- poetry build
- twine upload dist/*
- git tag {{.CLI_ARGS}}
- git push
- git push --tags
- gh release create --generate-notes {{.CLI_ARGS}}
- gh release upload {{.CLI_ARGS}} ./dist/*
Loading

0 comments on commit 1f6307a

Please sign in to comment.