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