summaryrefslogtreecommitdiff
path: root/.github/workflows/style.yaml
blob: d3955f717e8159b3255a5baf1926aef6f571904a (plain)
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
name: style
on:
  push:
  pull_request:
jobs:
  style:
    runs-on: ubuntu-latest
    # https://github.community/t/duplicate-checks-on-push-and-pull-request-simultaneous-event/18012/5
    if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'eventlet/eventlet'
    timeout-minutes: 5

    steps:
      - uses: actions/checkout@v2

      - name: cache pip
        uses: actions/cache@v2
        with:
          path: ~/.cache/pip
          key: ${{ runner.os }}-pip-${{ hashFiles('.github/workflows/style.yaml') }}
          restore-keys: |
            ${{ runner.os }}-pip-
            ${{ runner.os }}-
      - name: cache tox
        uses: actions/cache@v2
        with:
          path: .tox
          key: ${{ runner.os }}-tox-style-${{ hashFiles('tox.ini') }}
          restore-keys: |
            ${{ runner.os }}-tox-style-
            ${{ runner.os }}-tox-
            ${{ runner.os }}-

      - name: setup python
        uses: actions/setup-python@v2
        with:
          python-version: 3.x
      - name: install tox
        run: pip install tox
      - name: run tests
        run: tox --verbose -e pep8