-
Notifications
You must be signed in to change notification settings - Fork 49
38 lines (36 loc) · 1.26 KB
/
test.clients.python.yml
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
name: Linting and tests for the Moonstream Python client library
on:
pull_request:
branches:
- "main"
paths:
- "clients/python/**"
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up python
uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Install test requirements
working-directory: ./clients/python
run: pip install -e .[dev]
- name: Mypy type check
working-directory: ./clients/python
run: mypy moonstream/
- name: Black syntax check
working-directory: ./clients/python
run: black --check moonstream/
- name: Unit tests
working-directory: ./clients/python
run: python -m unittest discover -v
- name: Check that versions are synchronized
working-directory: ./clients/python
run: |
MOONSTREAM_CLIENT_VERSION=$(python -c "from moonstream.client import MOONSTREAM_CLIENT_VERSION; print(MOONSTREAM_CLIENT_VERSION)")
SETUP_PY_VERSION=$(python setup.py --version)
echo "Client version: $MOONSTREAM_CLIENT_VERSION"
echo "setup.py version: $SETUP_PY_VERSION"
test "$MOONSTREAM_CLIENT_VERSION" = "$SETUP_PY_VERSION"