summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Mueller <30130371+cdce8p@users.noreply.github.com>2021-02-21 20:23:14 +0100
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2021-02-28 21:52:27 +0100
commit617a639e18411a7e141ab6ce614a52c830ef9fed (patch)
treebf4a381a034a9d405bbf41facaac3915dfc9b5cd
parenteadc07e51e46fb50be9ec550ff050c25bc03c889 (diff)
downloadpylint-git-617a639e18411a7e141ab6ce614a52c830ef9fed.tar.gz
CI - Add new windows jobs
-rw-r--r--.github/workflows/ci.yaml78
1 files changed, 78 insertions, 0 deletions
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index 4273a07ac..483894eb0 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -346,6 +346,84 @@ jobs:
path: .benchmarks/
+ prepare-tests-windows:
+ name: Prepare tests for Python ${{ matrix.python-version }} (Windows)
+ runs-on: windows-latest
+ strategy:
+ matrix:
+ python-version: [3.6, 3.7, 3.8, 3.9]
+ outputs:
+ python-key: ${{ steps.generate-python-key.outputs.key }}
+ steps:
+ - name: Check out code from GitHub
+ uses: actions/checkout@v2
+ - name: Set up Python ${{ matrix.python-version }}
+ id: python
+ uses: actions/setup-python@v2
+ with:
+ python-version: ${{ matrix.python-version }}
+ - name: Generate partial Python venv restore key
+ id: generate-python-key
+ run: >-
+ echo "::set-output name=key::venv-${{ env.CACHE_VERSION }}-${{
+ hashFiles('pylint/__pkg_info__.py', 'requirements_test_pypy.txt') }}"
+ - name: Restore Python virtual environment
+ id: cache-venv
+ uses: actions/cache@v2
+ with:
+ path: venv
+ key: >-
+ ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
+ steps.generate-python-key.outputs.key }}
+ restore-keys: |
+ ${{ runner.os }}-${{ steps.python.outputs.python-version }}-venv-${{ env.CACHE_VERSION }}-
+ - name: Create Python virtual environment
+ if: steps.cache-venv.outputs.cache-hit != 'true'
+ run: |
+ python -m venv venv
+ . venv\\Scripts\\activate
+ python -m pip install -U pip setuptools wheel
+ pip install -U -r requirements_test_pypy.txt
+ pip install -e .
+
+ pytest-windows:
+ name: Run tests Python ${{ matrix.python-version }} (Windows)
+ runs-on: windows-latest
+ needs: prepare-tests-windows
+ strategy:
+ fail-fast: false
+ matrix:
+ python-version: [3.6, 3.7, 3.8, 3.9]
+ steps:
+ - name: Set temp directory
+ run: echo "TEMP=$env:USERPROFILE\AppData\Local\Temp" >> $env:GITHUB_ENV
+ # Workaround to set correct temp directory on Windows
+ # https://github.com/actions/virtual-environments/issues/712
+ - name: Check out code from GitHub
+ uses: actions/checkout@v2
+ - name: Set up Python ${{ matrix.python-version }}
+ id: python
+ uses: actions/setup-python@v2
+ with:
+ python-version: ${{ matrix.python-version }}
+ - name: Restore Python virtual environment
+ id: cache-venv
+ uses: actions/cache@v2
+ with:
+ path: venv
+ key: ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
+ needs.prepare-tests-windows.outputs.python-key }}
+ - name: Fail job if Python cache restore failed
+ if: steps.cache-venv.outputs.cache-hit != 'true'
+ run: |
+ echo "Failed to restore Python venv from cache"
+ exit 1
+ - name: Run pytest
+ run: |
+ . venv\\Scripts\\activate
+ pytest --benchmark-disable tests/
+
+
prepare-tests-pypy:
name: Prepare tests for Python ${{ matrix.python-version }}
runs-on: ubuntu-latest