|
| 1 | +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions |
| 2 | +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions |
| 3 | + |
| 4 | +name: Python package |
| 5 | + |
| 6 | +on: |
| 7 | + push: |
| 8 | + branches: [ develop ] |
| 9 | + pull_request: |
| 10 | + branches: [ develop ] |
| 11 | + |
| 12 | +jobs: |
| 13 | + build: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + strategy: |
| 16 | + max-parallel: 1 |
| 17 | + matrix: |
| 18 | + python-version: [3.6, 3.7] |
| 19 | + |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v2 |
| 22 | + |
| 23 | + - name: Set up Python ${{ matrix.python-version }} |
| 24 | + uses: actions/setup-python@v2 |
| 25 | + with: |
| 26 | + python-version: ${{ matrix.python-version }} |
| 27 | + - name: Install dependencies |
| 28 | + run: | |
| 29 | + python -m pip install --upgrade pip |
| 30 | + pip install flake8 tox tox-gh-actions |
| 31 | + python setup.py install |
| 32 | + - name: Lint with flake8 |
| 33 | + run: | |
| 34 | + # stop the build if there are Python syntax errors or undefined names |
| 35 | + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics |
| 36 | + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide |
| 37 | + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics |
| 38 | + - name: Test with tox |
| 39 | + env: |
| 40 | + # make sure to tell tox to use these environs in tox.ini |
| 41 | + LABELBOX_TEST_API_KEY: ${{ secrets.LABELBOX_API_KEY }} |
| 42 | + LABELBOX_TEST_ENDPOINT: "https://api.labelbox.com/graphql" |
| 43 | + # TODO: create a staging environment (develop) |
| 44 | + # we only test against prod right now because the merges are right into |
| 45 | + # the main branch which is develop right now |
| 46 | + LABELBOX_TEST_ENVIRON: "PROD" |
| 47 | + run: | |
| 48 | + tox -- -svv |
0 commit comments