Skip to content

Commit 1f6307a

Browse files
authored
add ci and update deps (#3)
* add ci and update deps * fix ci trigger
1 parent ae8e811 commit 1f6307a

File tree

3 files changed

+257
-188
lines changed

3 files changed

+257
-188
lines changed

.github/workflows/python-package.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: main
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request: {}
8+
9+
concurrency:
10+
group: ${{ github.head_ref || github.run_id }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
lint:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
- uses: actions/setup-python@v4
19+
with:
20+
python-version: "3.10"
21+
- uses: arduino/setup-task@v1
22+
with:
23+
repo-token: ${{ github.token }}
24+
- run: pip install poetry
25+
- run: task install
26+
- run: task lint-ci
27+
28+
pytest:
29+
runs-on: ubuntu-latest
30+
strategy:
31+
fail-fast: false
32+
matrix:
33+
python-version:
34+
- "3.10"
35+
- "3.11"
36+
- "3.12"
37+
steps:
38+
- uses: actions/checkout@v3
39+
- uses: actions/setup-python@v4
40+
with:
41+
python-version: ${{ matrix.python-version }}
42+
- uses: arduino/setup-task@v1
43+
with:
44+
repo-token: ${{ github.token }}
45+
- run: pip install poetry
46+
- run: task install
47+
- run: task tests

Taskfile.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,29 @@ tasks:
1313
- poetry run ruff check . --fix
1414
- poetry run mypy .
1515

16+
lint-ci:
17+
desc: "run linters"
18+
cmds:
19+
- poetry run ruff format . --check
20+
- poetry run ruff check . --no-fix
21+
- poetry run mypy .
22+
1623
tests:
1724
desc: "run pytest (pass args after '--')"
1825
cmds:
1926
- poetry run pytest {{.CLI_ARGS}}
27+
28+
release:
29+
desc: "bump version, create tag and release, publish to PYPI"
30+
cmds:
31+
- rm -rf ./dist
32+
- poetry version {{.CLI_ARGS}}
33+
- git add pyproject.toml
34+
- git commit -m "bump version to {{.CLI_ARGS}}"
35+
- poetry build
36+
- twine upload dist/*
37+
- git tag {{.CLI_ARGS}}
38+
- git push
39+
- git push --tags
40+
- gh release create --generate-notes {{.CLI_ARGS}}
41+
- gh release upload {{.CLI_ARGS}} ./dist/*

0 commit comments

Comments
 (0)