2021-01-21 19:04:01 +05:30
|
|
|
name: Tests
|
|
|
|
|
2022-08-31 22:36:44 +02:00
|
|
|
on:
|
|
|
|
push:
|
2022-09-07 21:33:40 +02:00
|
|
|
branches: master]
|
2022-08-31 22:36:44 +02:00
|
|
|
pull_request:
|
2022-09-07 21:33:40 +02:00
|
|
|
branches: [master]
|
2022-08-31 22:36:44 +02:00
|
|
|
types: [opened, reopened]
|
2021-01-21 19:04:01 +05:30
|
|
|
|
|
|
|
env:
|
2021-11-23 15:43:11 +02:00
|
|
|
PYTHON_LATEST: "3.10"
|
2021-01-21 19:04:01 +05:30
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
2021-11-23 15:43:11 +02:00
|
|
|
python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10"]
|
2021-01-21 19:04:01 +05:30
|
|
|
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
|
|
|
|
id: cache-deps
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
${{ env.pythonLocation }}/bin/*
|
|
|
|
${{ env.pythonLocation }}/lib/*
|
|
|
|
${{ env.pythonLocation }}/scripts/*
|
|
|
|
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.py', 'requirements.txt') }}
|
|
|
|
- name: Install The Fuck with all dependencies
|
|
|
|
if: steps.cache-deps.outputs.cache-hit != 'true'
|
|
|
|
run: |
|
|
|
|
pip install -Ur requirements.txt coveralls
|
|
|
|
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 pytest -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 pytest -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 --service=github
|