-
Notifications
You must be signed in to change notification settings - Fork 2
73 lines (56 loc) · 2.1 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: CI
on:
pull_request:
types: [opened, ready_for_review, synchronize]
push:
branches:
- main
workflow_dispatch:
jobs:
test:
name: Test
strategy:
fail-fast: false
matrix:
os: [ windows-2022, ubuntu-22.04 ]
python-version: [ "3.10", "3.11" ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install Python and set up Poetry
uses: bakdata/ci-templates/actions/[email protected]
with:
poetry-version: "1.5.1"
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: poetry install --no-interaction
- name: Lint (flake8)
run: poetry run pre-commit run flake8 --all-files --show-diff-on-failure
- name: Order of imports (isort)
run: poetry run pre-commit run isort --all-files --show-diff-on-failure
- name: Formatting (black)
run: poetry run pre-commit run black --all-files --show-diff-on-failure
- name: Typing (mypy)
run: poetry run pre-commit run mypy --all-files
- name: Typing (pyright)
run: poetry run pre-commit run pyright --all-files
- name: Generate schema (kpops schema)
run: poetry run pre-commit run gen-schema --all-files --show-diff-on-failure
- name: Generate docs (typer-cli)
run: poetry run pre-commit run gen-docs --all-files --show-diff-on-failure
# TODO: enable when PEP 604 incompatibilty is in typer is resolved https://github.com/tiangolo/typer/issues/348
# See https://github.com/tiangolo/typer/pull/522
# - name: Syntax (pyupgrade)
# run: poetry run pre-commit run --hook-stage manual pyupgrade --all-files
- name: Test
run: poetry run pytest tests
- name: Install docs dependencies
run: poetry install --with docs
- name: Test docs build (mkdocs)
run: poetry run mkdocs build -f docs/mkdocs.yml
publish:
name: Publish
needs: [test]
uses: ./.github/workflows/publish-test-pypi.yaml
secrets:
test-pypi-token: ${{ secrets.TEST_PYPI_TOKEN }}