| 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] |
| include: |
| - python-version: pypy3 |
| os: ubuntu-latest |
| |
| steps: |
| - uses: actions/checkout@v2 |
| - name: Set up Python ${{ matrix.python-version }} |
| uses: actions/setup-python@v1 |
| 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: | |
| pip install -r extra_requirements.txt |
| - name: Run unit tests with extra packages as non-root user |
| run: | |
| python -m pyfakefs.tests.all_tests |
| - name: Run pytest tests |
| run: | |
| export PY_VERSION=${{ matrix.python-version }} |
| $GITHUB_WORKSPACE/.github/workflows/run_pytest.sh |
| shell: bash |
| - name: Run performance tests |
| run: | |
| if [[ '${{ matrix.os }}' != 'macOS-latest' ]]; then |
| export TEST_PERFORMANCE=1 |
| python -m pyfakefs.tests.performance_test |
| fi |
| shell: bash |