Do CI linting on only one machine
Fixes
@@ -3,6 +3,31 @@ name: tests
on: [push, pull_request]
jobs:
+ lint:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Install dependencies
+ uses: actions/setup-python@v2
+ with:
+ python-version: "3.10"
+ - name: Install dependencies
+ run: |
+ pip install --upgrade pip
+ pip install -e .
+ - name: Install test dependencies
+ run: pip install -r requirements.txt
+ - name: flake8
+ run: flake8 dedupe tests benchmarks/benchmarks
+ - name: isort
+ if: always()
+ run: isort --check-only .
+ - name: black
+ if: always()
+ run: black . --check
+ - name: mypy
+ if: always()
+ run: mypy
test:
timeout-minutes: 40
runs-on: ${{ matrix.os }}
@@ -13,7 +38,7 @@ jobs:
python-version: [3.7, 3.8, 3.9, "3.10"]
steps:
- - uses: actions/checkout@v1
+ - uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
@@ -23,11 +48,9 @@ jobs:
pip install --upgrade pip
pip install -e .
- name: Install test dependencies
- run: |
- pip install -r requirements.txt
+ run: pip install -r requirements.txt
- name: pytest
- run: |
- pytest
+ run: pytest
- env:
COVERALLS_PARALLEL: true
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -36,18 +59,6 @@ jobs:
run: |
pip install https://github.com/bboe/coveralls-python/archive/github_actions.zip
coveralls
- - name: flake8
- run: |
- flake8 dedupe tests benchmarks/benchmarks
- - name: isort
- run: |
- isort --check-only .
- - name: black
- run: |
- black . --check
- - name: mypy
- run: |
- mypy
- name: Integration tests
# Do everything twice: The first time is training and generates settings,
# the second time it tests using a static settings file.
@@ -70,14 +81,14 @@ jobs:
parallel-finished: true
wheels:
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
- needs: test
+ needs: [test, lint]
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
steps:
- - uses: actions/checkout@v1
+ - uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Build wheels
uses: pypa/cibuildwheel@2.6.0
