| name: Test and lint |
| |
| on: |
| push: |
| pull_request: |
| |
| permissions: |
| contents: read |
| |
| jobs: |
| tests: |
| name: Run tests |
| |
| strategy: |
| fail-fast: false |
| matrix: |
| python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"] |
| |
| runs-on: ubuntu-latest |
| |
| steps: |
| - uses: actions/checkout@v2 |
| |
| - name: Set up Python |
| uses: actions/setup-python@v2 |
| with: |
| python-version: ${{ matrix.python-version }} |
| |
| - name: Load pip cache |
| uses: actions/cache@v2 |
| with: |
| path: ~/.cache/pip |
| key: ${{ runner.os }}-pip-${{ hashFiles('**/test-requirements.txt') }} |
| restore-keys: | |
| ${{ runner.os }}-pip- |
| |
| - name: Install dependencies |
| run: | |
| pip install --upgrade pip |
| pip install -r test-requirements.txt |
| |
| - name: Test typing_extensions |
| run: pytest typing_extensions/src_py3 |
| |
| linting: |
| name: Lint |
| |
| runs-on: ubuntu-latest |
| |
| steps: |
| - uses: actions/checkout@v2 |
| |
| - name: Set up Python |
| uses: actions/setup-python@v2 |
| with: |
| python-version: 3.9 |
| |
| - name: Load pip cache |
| uses: actions/cache@v2 |
| with: |
| path: ~/.cache/pip |
| key: ${{ runner.os }}-pip-${{ hashFiles('**/test-requirements.txt') }} |
| restore-keys: | |
| ${{ runner.os }}-pip- |
| |
| - name: Install dependencies |
| run: | |
| pip install --upgrade pip |
| pip install -r test-requirements.txt |
| |
| - name: Lint implementation |
| run: flake8 |
| |
| - name: Lint tests |
| run: flake8 --config=.flake8-tests typing_extensions/src_py3/test_typing_extensions.py |