|
| 1 | +name: Static Analysis & Test |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + |
| 7 | + static-analysis: |
| 8 | + |
| 9 | + # We want to run on external PRs, but not on our own internal PRs as they'll |
| 10 | + # be run by the push to the branch. Without this if check, checks are |
| 11 | + # duplicated since internal PRs match both the push and pull_request events. |
| 12 | + # https://github.com/psf/black/blob/f51e53726b39a177355a7917c91c56f390dda7ef/.github/workflows/lint.yml#L7-L12 |
| 13 | + if: |
| 14 | + github.event_name == 'push' || github.event.pull_request.head.repo.full_name != |
| 15 | + github.repository |
| 16 | + |
| 17 | + runs-on: ubuntu-latest |
| 18 | + |
| 19 | + steps: |
| 20 | + - name: Checkout code |
| 21 | + uses: actions/checkout@v2 |
| 22 | + |
| 23 | + - name: Setup Python |
| 24 | + uses: actions/setup-python@v2 |
| 25 | + with: |
| 26 | + python-version: "3.x" |
| 27 | + |
| 28 | + - name: Install dependencies |
| 29 | + run: | |
| 30 | + python -m pip install --upgrade pip |
| 31 | + python -m pip install tox |
| 32 | +
|
| 33 | + - name: Lint with flake8 |
| 34 | + run: tox -e flake8 |
| 35 | + |
| 36 | + - name: Format with black |
| 37 | + run: tox -e black |
| 38 | + |
| 39 | + |
| 40 | + # test: |
| 41 | + |
| 42 | + # # We want to run on external PRs, but not on our own internal PRs as they'll |
| 43 | + # # be run by the push to the branch. Without this if check, checks are |
| 44 | + # # duplicated since internal PRs match both the push and pull_request events. |
| 45 | + # if: |
| 46 | + # github.event_name == 'push' || github.event.pull_request.head.repo.full_name != |
| 47 | + # github.repository |
| 48 | + |
| 49 | + # runs-on: ubuntu-latest |
| 50 | + |
| 51 | + # strategy: |
| 52 | + # matrix: |
| 53 | + # python: ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10"] |
| 54 | + |
| 55 | + # steps: |
| 56 | + # - name: Checkout code |
| 57 | + # uses: actions/checkout@v2 |
| 58 | + |
| 59 | + # - name: Setup Python |
| 60 | + # uses: actions/setup-python@v2 |
| 61 | + # with: |
| 62 | + # python-version: ${{ matrix.python }} |
| 63 | + |
| 64 | + # - name: Install dependencies |
| 65 | + # run: | |
| 66 | + # python -m pip install --upgrade pip |
| 67 | + # python -m pip install tox |
| 68 | + |
| 69 | + # - name: Run Tox |
| 70 | + # run: | |
| 71 | + # tox -e py |
0 commit comments