This repository has been archived by the owner on Oct 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
99 lines (86 loc) · 2.89 KB
/
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
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
---
name: Python
"on":
pull_request:
branches:
- develop
- main
paths:
- "external/**"
- "grpc/clients/python/**"
- "grpc/examples/python/**"
- "proto/**"
- "rest/examples/python/**"
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9"]
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Lint with flake8
run: |
command -v flake8 1>/dev/null || pip install flake8
make flake8
- name: Lint with black
run: |
command -v black 1>/dev/null || pip install black
make blackcheck
- name: Type-check with mypy
run: |
sudo apt update
sudo env DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends python3-virtualenv
make mypy
- name: Test with pytest
env:
GRPC_NODE: ${{ secrets.GRPC_NODE }}
FAUCETSERVER: ${{ secrets.FAUCETSERVER }}
WALLETSERVER: ${{ secrets.WALLETSERVER }}
run: |
cd grpc/clients/python
command -v pipenv 1>/dev/null || pip install pipenv
make test
- name: Check archive file counts
run: |
cd grpc/clients/python
python3 setup.py sdist bdist_wheel
make check_dist
- name: Run example scripts for gRPC
env:
NODE_URL_GRPC: ${{ secrets.GRPC_NODE }}
WALLET_NAME: ${{ secrets.WALLET_NAME }}
WALLET_PASSPHRASE: ${{ secrets.WALLET_PASSPHRASE }}
WALLETSERVER_URL: ${{ secrets.WALLETSERVER }}
run: |
command -v pipenv 1>/dev/null || pip install pipenv
cd grpc/examples/python
make ci
if: ${{ matrix.python-version == '3.9' }}
# - name: Run example scripts for GraphQL
# env:
# NODE_URL_REST: ${{ secrets.NODE_URL_REST }}
# WALLET_NAME: ${{ secrets.WALLET_NAME }}
# WALLET_PASSPHRASE: ${{ secrets.WALLET_PASSPHRASE }}
# WALLETSERVER_URL: ${{ secrets.WALLETSERVER }}
# run: |
# command -v pipenv 1>/dev/null || pip install pipenv
# cd graphql/examples/python
# make # no "ci" here, yet
# if: ${{ matrix.python-version == '3.9' }}
- name: Run example scripts for REST
env:
NODE_URL_REST: ${{ secrets.NODE_URL_REST }}
WALLET_NAME: ${{ secrets.WALLET_NAME }}
WALLET_PASSPHRASE: ${{ secrets.WALLET_PASSPHRASE }}
WALLETSERVER_URL: ${{ secrets.WALLETSERVER }}
run: |
command -v pipenv 1>/dev/null || pip install pipenv
cd rest/examples/python
make ci
if: ${{ matrix.python-version == '3.9' }}