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