|
| 1 | +# This workflow will install Python dependencies, run tests and lint with a single version of Python |
| 2 | +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions |
| 3 | + |
| 4 | +name: Python Build |
| 5 | + |
| 6 | +on: |
| 7 | + push: |
| 8 | + branches: [ main, develop ] |
| 9 | + pull_request: |
| 10 | + branches: [ main, develop ] |
| 11 | + |
| 12 | +jobs: |
| 13 | + build: |
| 14 | + strategy: |
| 15 | + fail-fast: false |
| 16 | + max-parallel: 2 |
| 17 | + matrix: |
| 18 | + python-version: [ "3.9", "3.10" ] |
| 19 | + poetry-version: [ "1.1.14" ] |
| 20 | + # os: [ ubuntu-18.04, macos-latest, windows-latest ] |
| 21 | + os: [ ubuntu-18.04, macos-latest ] |
| 22 | + runs-on: ${{ matrix.os }} |
| 23 | + steps: |
| 24 | + - uses: actions/checkout@v2 |
| 25 | + - name: Set up Python |
| 26 | + uses: actions/setup-python@v2 |
| 27 | + with: |
| 28 | + python-version: ${{ matrix.python-version }} |
| 29 | + - name: Install Poetry |
| 30 | + uses: abatilo/actions-poetry@v2.0.0 |
| 31 | + with: |
| 32 | + poetry-version: ${{ matrix.poetry-version }} |
| 33 | + - name: Install dependencies |
| 34 | + run: | |
| 35 | + poetry install |
| 36 | + - name: Lint with flake8 |
| 37 | + run: | |
| 38 | + # stop the build if there are Python syntax errors or undefined names |
| 39 | + poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics |
| 40 | + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide |
| 41 | + poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics |
| 42 | + - name: Test with pytest |
| 43 | + run: | |
| 44 | + poetry run pytest -m "not regression" |
| 45 | + - name: Regression Test with pytest |
| 46 | + env: |
| 47 | + PODAAC_LOGLEVEL: "DEBUG" |
| 48 | + run: | |
| 49 | + poetry run pytest -o log_cli=true --log-cli-level=DEBUG -m "regression" |
0 commit comments