blob: df96fa490a07a29ed06316459a7722a48be29c22 [file] [log] [blame]
name: Testsuite
on:
[push, pull_request]
jobs:
linter:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.8]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install linter
run: |
uname -a
python -m pip install flake8
- name: Check syntax and style
run: flake8 . --exclude get-pip.py --max-complexity=13 --statistics
tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest, windows-2016]
python-version: [3.6, 3.7, 3.8, 3.9, 3.10.0-beta.1]
include:
- python-version: pypy3
os: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Get pip cache dir
id: pip-cache
run: |
python -m pip install --upgrade pip
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache dependencies
id: cache-dep
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ matrix.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/extra_requirements.txt') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.python-version }}-pip-
- name: Install dependencies
run: |
pip install wheel
pip install -r requirements.txt
pip install .
- name: Run unit tests without extra packages as non-root user
run: |
export TEST_REAL_FS=1
python -m pyfakefs.tests.all_tests_without_extra_packages
shell: bash
- name: Run setup.py test (uses pytest)
run: |
python setup.py test
shell: bash
- name: Run unit tests without extra packages as root
run: |
if [[ '${{ matrix.os }}' != 'windows-2016' ]]; then
# provide the same path as non-root to get the correct virtualenv
sudo env "PATH=$PATH" python -m pyfakefs.tests.all_tests_without_extra_packages
fi
shell: bash
- name: Install extra dependencies
run: |
# some extra dependencies are not avaialble in 3.10 Beta yet
# so we exclude it from all tests on extra dependencies
if [[ '${{ matrix.python-version }}' != '3.10.0-beta.1' ]]; then
pip install -r extra_requirements.txt
fi
shell: bash
- name: Run unit tests with extra packages as non-root user
run: |
if [[ '${{ matrix.python-version }}' != '3.10.0-beta.1' ]]; then
python -m pyfakefs.tests.all_tests
fi
shell: bash
- name: Run pytest tests
run: |
if [[ '${{ matrix.python-version }}' != '3.10.0-beta.1' ]]; then
export PY_VERSION=${{ matrix.python-version }}
$GITHUB_WORKSPACE/.github/workflows/run_pytest.sh
fi
shell: bash
- name: Run performance tests
run: |
if [[ '${{ matrix.os }}' != 'macOS-latest' && '${{ matrix.python-version }}' != '3.10.0-beta.1' ]]; then
export TEST_PERFORMANCE=1
python -m pyfakefs.tests.performance_test
fi
shell: bash