Skip to content

Commit 490c393

Browse files
committed
parallelize
1 parent 16bbc6c commit 490c393

File tree

1 file changed

+56
-58
lines changed

1 file changed

+56
-58
lines changed

.github/workflows/python-package.yml

Lines changed: 56 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -2,85 +2,83 @@ name: Labelbox Python SDK
22

33
on:
44
push:
5-
branches: [ develop, master ]
5+
branches: [develop, master]
66
pull_request:
7-
branches: [ develop, master ]
7+
branches: [develop, master]
88

99
jobs:
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
1516
matrix:
1617
# TODO: unlock parallel testing by using more API keys
17-
python-test:
18+
python-test:
1819
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}}]
2120

2221
steps:
22+
- name: Cancel previous workflow
23+
uses: styfle/cancel-workflow-action@0.4.0
24+
with:
25+
access_token: ${{ github.token }}
2326

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: |
27+
- name: set environment for branch
28+
run: |
3129
if [[ "${{github.base_ref}}" == "master" || "${{github.ref}}" == "refs/heads/master" ]]; then
3230
echo "LABELBOX_TEST_ENVIRON=prod" >> $GITHUB_ENV
3331
else
3432
echo "LABELBOX_TEST_ENVIRON=staging" >> $GITHUB_ENV
3533
fi
3634
37-
- uses: actions/checkout@v2
38-
with:
39-
token: ${{ secrets.ACTIONS_ACCESS_TOKEN }}
40-
ref: ${{ github.head_ref }}
35+
- uses: actions/checkout@v2
36+
with:
37+
token: ${{ secrets.ACTIONS_ACCESS_TOKEN }}
38+
ref: ${{ github.head_ref }}
4139

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 }}
40+
- name: Set up Python ${{ matrix.python-test.version }}
41+
uses: actions/setup-python@v2
42+
with:
43+
python-test.version: ${{ matrix.python-test.version }}
4644

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
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
7270
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}}
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 }}
8280

83-
# randall+staging-python@labelbox.com
84-
LABELBOX_TEST_API_KEY_STAGING: ${{ matrix.python-test.staging-key}}
85-
run: |
86-
tox -e py -- -svvx
81+
# randall+staging-python@labelbox.com
82+
LABELBOX_TEST_API_KEY_STAGING: ${{ secrets.STAGING_LABELBOX_API_KEY }}
83+
run: |
84+
tox -e py -- -svvx

0 commit comments

Comments
 (0)