Skip to content

Commit 98e11ab

Browse files
committed
parallelize
1 parent 0b1a04a commit 98e11ab

File tree

1 file changed

+56
-59
lines changed

1 file changed

+56
-59
lines changed

.github/workflows/python-package.yml

Lines changed: 56 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -2,85 +2,82 @@ 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-info:
18-
python-version: [3.6, 3.7, 3.8]
19-
python-prod-key: [${{ secrets.LABELBOX_API_KEY}}, ${{ secrets.PROD_LABELBOX_API_KEY_2}},${{ secrets.PROD_LABELBOX_API_KEY_3}}]
20-
python-staging-key: [${{ secrets.STAGING_LABELBOX_API_KEY}}, ${{ secrets.STAGING_LABELBOX_API_KEY_2}},${{ secrets.STAGING_LABELBOX_API_KEY_3}}]
18+
python-version: [3.6, 3.7, 3.8]
2119

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

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: |
26+
- name: set environment for branch
27+
run: |
3128
if [[ "${{github.base_ref}}" == "master" || "${{github.ref}}" == "refs/heads/master" ]]; then
3229
echo "LABELBOX_TEST_ENVIRON=prod" >> $GITHUB_ENV
3330
else
3431
echo "LABELBOX_TEST_ENVIRON=staging" >> $GITHUB_ENV
3532
fi
3633
37-
- uses: actions/checkout@v2
38-
with:
39-
token: ${{ secrets.ACTIONS_ACCESS_TOKEN }}
40-
ref: ${{ github.head_ref }}
34+
- uses: actions/checkout@v2
35+
with:
36+
token: ${{ secrets.ACTIONS_ACCESS_TOKEN }}
37+
ref: ${{ github.head_ref }}
4138

42-
- name: Set up Python ${{ matrix.python-test-info.python-version }}
43-
uses: actions/setup-python@v2
44-
with:
45-
python-version: ${{ matrix.python-test-info.python-version }}
39+
- name: Set up Python ${{ matrix.python-version }}
40+
uses: actions/setup-python@v2
41+
with:
42+
python-version: ${{ matrix.python-version }}
4643

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
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
7269
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-info.python-prod-key}}
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 }}
8279

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

0 commit comments

Comments
 (0)