-
Notifications
You must be signed in to change notification settings - Fork 360
76 lines (66 loc) · 2.14 KB
/
python-wrapper-unit-tests.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
74
75
76
name: Unit Test Python SDK Wrapper
on:
push:
branches:
- master
pull_request:
jobs:
paths-filter:
runs-on: ubuntu-latest
outputs:
client-change: ${{ steps.filter.outputs.client == 'true' }}
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
client:
- 'clients/python-wrapper/**'
- '.github/workflows/python-wrapper-unit-tests.yaml'
always-succeed:
needs: paths-filter
if: ${{ needs.paths-filter.outputs.client-change != 'true' }}
name: Unit Test Python SDK Wrapper
runs-on: ubuntu-22.04
steps:
- name: Always Succeed
run: echo "No changes in client - skipping unit tests"
unit-tests:
needs: paths-filter
if: ${{ needs.paths-filter.outputs.client-change == 'true' }}
strategy:
fail-fast: false
matrix:
pydantic_v1: [ true, false ]
name: Unit Test Python SDK Wrapper
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
# When installed it will skip the installation of pydantic in the next step which will install the latest > 2
- name: Install pydantic V1
if: matrix.pydantic_v1
run: pip install pydantic==1.10.6
- name: Install dependencies
working-directory: ./clients/python-wrapper
run: pip install -r requirements.txt pylint pytest pytest-md pytest-emoji
- name: Generate Documentation
run: make python-wrapper-gen-docs
- name: Validate Documentation
run: make validate-python-wrapper
- name: Run Pylint
run: make python-wrapper-lint
- name: Run Unit Tests
uses: pavelzw/pytest-action@v2
with:
verbose: true
emoji: true
job-summary: true
custom-arguments: './clients/python-wrapper/tests/utests -q -We'
click-to-expand: true
report-title: 'Python Wrapper Unit Tests Report'