mirror of
https://github.com/nvbn/thefuck.git
synced 2025-03-19 00:58:56 +00:00
56 lines
1.9 KiB
YAML
56 lines
1.9 KiB
YAML
name: Tests
|
|
|
|
on: [push, pull_request]
|
|
|
|
env:
|
|
PYTHON_LATEST: 3.9
|
|
|
|
jobs:
|
|
test:
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10-dev]
|
|
fail-fast: false
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
- name: Cache dependencies
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
${{ env.pythonLocation }}/lib/*/site-packages/*
|
|
${{ env.pythonLocation }}/bin/*
|
|
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.py', 'requirements.txt') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pip-${{ matrix.python-version }}-
|
|
${{ runner.os }}-pip-
|
|
${{ runner.os }}-
|
|
- name: Install dependencies
|
|
run: |
|
|
pip install -U wheel setuptools coveralls
|
|
pip install -Ur requirements.txt
|
|
python setup.py develop
|
|
- name: Lint
|
|
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == env.PYTHON_LATEST }}
|
|
run: |
|
|
flake8
|
|
- name: Run tests
|
|
if: ${{ matrix.os != 'ubuntu-latest' || matrix.python-version != env.PYTHON_LATEST }}
|
|
run: |
|
|
coverage run --source=thefuck,tests -m py.test -v --capture=sys tests
|
|
- name: Run tests (including functional)
|
|
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == env.PYTHON_LATEST }}
|
|
run: |
|
|
coverage run --source=thefuck,tests -m py.test -v --capture=sys tests --enable-functional
|
|
- name: Post coverage results
|
|
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == env.PYTHON_LATEST }}
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
coveralls
|