forked from Labelbox/labelbox-python
-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (86 loc) · 3.15 KB
/
python-package.yml
File metadata and controls
97 lines (86 loc) · 3.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Labelbox Python SDK
on:
push:
branches: [develop, master]
pull_request:
branches: [develop, master]
jobs:
build:
if: github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
strategy:
matrix:
include:
- python-version: 3.7
prod-key: LABELBOX_API_KEY
staging-key: STAGING_LABELBOX_API_KEY
da-test-key: DA_GCP_LABELBOX_API_KEY
- python-version: 3.8
prod-key: PROD_LABELBOX_API_KEY_2
staging-key: STAGING_LABELBOX_API_KEY_2
da-test-key: DA_GCP_LABELBOX_API_KEY
- python-version: 3.9
prod-key: PROD_LABELBOX_API_KEY_3
staging-key: STAGING_LABELBOX_API_KEY_3
da-test-key: DA_GCP_LABELBOX_API_KEY
- python-version: '3.10'
prod-key: PROD_LABELBOX_API_KEY_4
staging-key: STAGING_LABELBOX_API_KEY_4
da-test-key: DA_GCP_LABELBOX_API_KEY
steps:
- name: Cancel previous workflow
uses: styfle/cancel-workflow-action@0.4.0
with:
access_token: ${{ github.token }}
- name: set environment for branch
run: |
if [[ "${{github.base_ref}}" == "master" || "${{github.ref}}" == "refs/heads/master" ]]; then
echo "LABELBOX_TEST_ENVIRON=prod" >> $GITHUB_ENV
else
echo "LABELBOX_TEST_ENVIRON=staging" >> $GITHUB_ENV
echo "FIXTURE_PROFILE=true" >> $GITHUB_ENV
fi
- uses: actions/checkout@v2
with:
token: ${{ secrets.ACTIONS_ACCESS_TOKEN }}
ref: ${{ github.head_ref }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: yapf
id: yapf
uses: AlexanderMelde/yapf-action@master
with:
args: --verbose --recursive --parallel --style "google"
- name: dependencies
run: |
sudo apt-get -y update
sudo apt install -y libsm6 \
libxext6 \
ffmpeg \
libfontconfig1 \
libxrender1 \
libgl1-mesa-glx
- name: install labelbox package
run: |
python -m pip install --upgrade pip
python -m pip install .
- name: mypy
run: |
pip install mypy==0.782
mypy -p labelbox --pretty --show-error-codes
- name: Install package and test dependencies
run: |
pip install tox==3.18.1 pytest-snapshot
# TODO: replace tox.ini with what the Makefile does
# to make sure local testing is
# identical to github actions which uses tox.ini
- name: Test with tox
env:
# make sure to tell tox to use these environs in tox.ini
LABELBOX_TEST_API_KEY_PROD: ${{ secrets[matrix.prod-key] }}
LABELBOX_TEST_API_KEY_STAGING: ${{ secrets[matrix.staging-key] }}
DA_GCP_LABELBOX_API_KEY: ${{ secrets[matrix.da-test-key] }}
run: |
tox -e py -- -n 10 -svv --reruns 5 --reruns-delay 8