@@ -2,9 +2,9 @@ name: Labelbox Python SDK
2
2
3
3
on :
4
4
push :
5
- branches : [develop, master]
5
+ branches : [ develop, master ]
6
6
pull_request :
7
- branches : [develop, master]
7
+ branches : [ develop, master ]
8
8
9
9
jobs :
10
10
build :
@@ -15,69 +15,81 @@ jobs:
15
15
max-parallel : 1
16
16
matrix :
17
17
# TODO: unlock parallel testing by using more API keys
18
- python-test.version : [3.6, 3.7, 3.8]
18
+ python-version : [3.6, 3.7, 3.8]
19
+ include :
20
+ -python-version : 3.6
21
+ prod-key : LABELBOX_API_KEY
22
+ staging-key : STAGING_LABELBOX_API_KEY
23
+ -python-version : 3.7
24
+ prod-key : PROD_LABELBOX_API_KEY_2
25
+ staging-key : STAGING_LABELBOX_API_KEY_2
26
+ -python-version : 3.8
27
+ prod-key : PROD_LABELBOX_API_KEY_3
28
+ staging-key : STAGING_LABELBOX_API_KEY_2
29
+
19
30
20
31
steps :
21
- - name : Cancel previous workflow
22
- uses : styfle/cancel-workflow-action@0.4.0
23
- with :
24
- access_token : ${{ github.token }}
25
32
26
- - name : set environment for branch
27
- run : |
33
+ - name : Cancel previous workflow
34
+ uses : styfle/cancel-workflow-action@0.4.0
35
+ with :
36
+ access_token : ${{ github.token }}
37
+
38
+ - name : set environment for branch
39
+ run : |
28
40
if [[ "${{github.base_ref}}" == "master" || "${{github.ref}}" == "refs/heads/master" ]]; then
29
41
echo "LABELBOX_TEST_ENVIRON=prod" >> $GITHUB_ENV
30
42
else
31
43
echo "LABELBOX_TEST_ENVIRON=staging" >> $GITHUB_ENV
32
44
fi
33
45
34
- - uses : actions/checkout@v2
35
- with :
36
- token : ${{ secrets.ACTIONS_ACCESS_TOKEN }}
37
- ref : ${{ github.head_ref }}
46
+ - uses : actions/checkout@v2
47
+ with :
48
+ token : ${{ secrets.ACTIONS_ACCESS_TOKEN }}
49
+ ref : ${{ github.head_ref }}
38
50
39
- - name : Set up Python ${{ matrix.python-test. version }}
40
- uses : actions/setup-python@v2
41
- with :
42
- python-test. version : ${{ matrix.python-test. version }}
51
+ - name : Set up Python ${{ matrix.python-version }}
52
+ uses : actions/setup-python@v2
53
+ with :
54
+ python-version : ${{ matrix.python-version }}
43
55
44
- - name : yapf
45
- id : yapf
46
- uses : AlexanderMelde/yapf-action@master
47
- with :
48
- args : --verbose --recursive --parallel --style "google"
49
- - name : dependencies
50
- run : |
51
- sudo apt-get -y update
52
- sudo apt install -y libsm6 \
53
- libxext6 \
54
- ffmpeg \
55
- libfontconfig1 \
56
- libxrender1 \
57
- libgl1-mesa-glx
58
- - name : install labelbox package
59
- run : |
60
- python -m pip install --upgrade pip
61
- python -m pip install .
62
- - name : mypy
63
- run : |
64
- pip install mypy==0.782
65
- mypy -p labelbox --pretty --show-error-codes
66
- - name : Install package and test dependencies
67
- run : |
68
- pip install tox==3.18.1
56
+ - name : yapf
57
+ id : yapf
58
+ uses : AlexanderMelde/yapf-action@master
59
+ with :
60
+ args : --verbose --recursive --parallel --style "google"
61
+ - name : dependencies
62
+ run : |
63
+ sudo apt-get -y update
64
+ sudo apt install -y libsm6 \
65
+ libxext6 \
66
+ ffmpeg \
67
+ libfontconfig1 \
68
+ libxrender1 \
69
+ libgl1-mesa-glx
70
+ - name : install labelbox package
71
+ run : |
72
+ python -m pip install --upgrade pip
73
+ python -m pip install .
74
+ - name : mypy
75
+ run : |
76
+ pip install mypy==0.782
77
+ mypy -p labelbox --pretty --show-error-codes
78
+ - name : Install package and test dependencies
79
+ run : |
80
+ pip install tox==3.18.1
69
81
70
- # TODO: replace tox.ini with what the Makefile does
71
- # to make sure local testing is
72
- # identical to github actions which uses tox.ini
73
- - name : Test with tox
74
- env :
75
- # make sure to tell tox to use these environs in tox.ini
76
- #
77
- # msokoloff+prod-python@labelbox.com
78
- LABELBOX_TEST_API_KEY_PROD : ${{ secrets.LABELBOX_API_KEY }}
82
+ # TODO: replace tox.ini with what the Makefile does
83
+ # to make sure local testing is
84
+ # identical to github actions which uses tox.ini
85
+ - name : Test with tox
86
+ env :
87
+ # make sure to tell tox to use these environs in tox.ini
88
+ #
89
+ # msokoloff+prod-python@labelbox.com
90
+ LABELBOX_TEST_API_KEY_PROD : ${{ secrets.[matrix.prod-key] }}
79
91
80
- # randall+staging-python@labelbox.com
81
- LABELBOX_TEST_API_KEY_STAGING : ${{ secrets.STAGING_LABELBOX_API_KEY }}
82
- run : |
83
- tox -e py -- -svvx
92
+ # randall+staging-python@labelbox.com
93
+ LABELBOX_TEST_API_KEY_STAGING : ${{ secrets.[matrix.staging-key] }}
94
+ run : |
95
+ tox -e py -- -svvx
0 commit comments