File tree Expand file tree Collapse file tree 3 files changed +73
-16
lines changed Expand file tree Collapse file tree 3 files changed +73
-16
lines changed Original file line number Diff line number Diff line change
1
+ name : ' rai-sdk-python test'
2
+
3
+ inputs :
4
+ client_id :
5
+ required : true
6
+ description : ' Client ID for oAuth'
7
+
8
+ client_secret :
9
+ required : true
10
+ description : ' Client secret for oAuth'
11
+
12
+ client_credentials_url :
13
+ required : true
14
+ description : ' Client credentials url for fetching the oAuth token'
15
+
16
+ rai_host :
17
+ required : false
18
+ description : ' RAI host'
19
+ default : ' azure-staging.relationalai.com'
20
+
21
+ custom_headers :
22
+ required : false
23
+ description : ' Optional http headers'
24
+ default : ' {}'
25
+
26
+ runs :
27
+ using : ' composite'
28
+ steps :
29
+ - uses : actions/checkout@v3
30
+ with :
31
+ repository : RelationalAI/rai-sdk-python
32
+ ref : ia-test-refactor
33
+
34
+ - name : Initialize Python 3.7
35
+ uses : actions/setup-python@v2
36
+ with :
37
+ python-version : 3.7
38
+
39
+ - name : Install dependencies
40
+ run : |
41
+ python -m pip install --upgrade pip
42
+ pwd
43
+ ls
44
+ pip install -r requirements.txt
45
+ pip install -e ./
46
+ shell : bash
47
+
48
+ - name : Generate Protobuf
49
+ run : |
50
+ python -m grpc_tools.protoc -I railib/pb --python_out=./railib/pb railib/pb/*.proto
51
+ shell : bash
52
+
53
+ - name : test
54
+ env :
55
+ CLIENT_ID : ${{ inputs.client_id }}
56
+ CLIENT_SECRET : ${{ inputs.client_secret }}
57
+ CLIENT_CREDENTIALS_URL : ${{ inputs.client_credentials_url }}
58
+ HOST : ${{ inputs.rai_host }}
59
+ CUSTOM_HEADERS : ${{ inputs.custom_headers }}
60
+ run : |
61
+ mkdir -p ~/.rai
62
+ python -m unittest
63
+ shell : bash
Original file line number Diff line number Diff line change 9
9
build :
10
10
runs-on : ubuntu-latest
11
11
steps :
12
- - uses : actions/checkout@v2
12
+ - uses : actions/checkout@v3
13
13
14
14
- name : Initialize Python 3.7
15
- uses : actions/setup-python@v1
15
+ uses : actions/setup-python@v2
16
16
with :
17
17
python-version : 3.7
18
18
19
19
- name : Install dependencies
20
20
run : |
21
21
python -m pip install --upgrade pip
22
22
pip install flake8
23
- pip install -r requirements.txt
24
- pip install -e ./
25
-
26
- - name : Generate Protobuf
27
- run : python -m grpc_tools.protoc -I railib/pb --python_out=./railib/pb railib/pb/*.proto
28
23
29
24
- name : flake8 linter
30
25
run : flake8 .
31
26
32
- - name : test
33
- env :
34
- CLIENT_ID : ${{ secrets.CLIENT_ID }}
35
- CLIENT_SECRET : ${{ secrets.CLIENT_SECRET }}
36
- CLIENT_CREDENTIALS_URL : ${{ secrets.CLIENT_CREDENTIALS_URL }}
37
- run : |
38
- mkdir -p ~/.rai
39
- python -m unittest
27
+ - uses : ./.github/actions/test
28
+ with :
29
+ client_id : ${{ secrets.CLIENT_ID }}
30
+ client_secret : ${{ secrets.CLIENT_SECRET }}
31
+ client_credentials_url : ${{ secrets.CLIENT_CREDENTIALS_URL }}
32
+ rai_host : ' azure.relationalai.com'
Original file line number Diff line number Diff line change 12
12
client_id = os .getenv ("CLIENT_ID" )
13
13
client_secret = os .getenv ("CLIENT_SECRET" )
14
14
client_credentials_url = os .getenv ("CLIENT_CREDENTIALS_URL" )
15
+ host = os .getenv ("HOST" )
15
16
custom_headers = json .loads (os .getenv ('CUSTOM_HEADERS' , '{}' ))
16
17
17
18
if client_id is None :
26
27
client_credentials_url={ client_credentials_url }
27
28
region=us-east
28
29
port=443
29
- host=azure.relationalai.com
30
+ host={ host }
30
31
""" )
31
32
file .seek (0 )
32
33
cfg = config .read (fname = file .name )
You can’t perform that action at this time.
0 commit comments