CI: Don't run stubtest_stdlib on PRs that don't touch the stdlib (#7895)

* Don't run stubtest_stdlib on PRs that don't touch the stdlib
This commit is contained in:
Alex Waygood
2022-05-20 15:56:29 +01:00
committed by GitHub
parent cd039c9b73
commit e2cf6c21d5
2 changed files with 43 additions and 23 deletions

43
.github/workflows/stubtest_stdlib.yml vendored Normal file
View File

@@ -0,0 +1,43 @@
name: Run stubtest on the stdlib
on:
workflow_dispatch:
push:
branches:
- main
- master
pull_request:
paths:
- 'stdlib/**'
- '.github/workflows/**'
- 'tests/**'
permissions:
contents: read
env:
PIP_DISABLE_PIP_VERSION_CHECK: 1
jobs:
stubtest-stdlib:
name: Check stdlib with stubtest
runs-on: ${{ matrix.os }}
strategy:
matrix:
# macos-11 does not have tcl/tk installed, needed for stubtesting tkinter
os: ["ubuntu-latest", "windows-latest", "macos-10.15"]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11-dev"]
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Update pip
run: python -m pip install -U pip
- name: Install dependencies
run: pip install $(grep tomli== requirements-tests.txt) $(grep mypy== requirements-tests.txt)
- name: Run stubtest
run: python tests/stubtest_stdlib.py

View File

@@ -92,29 +92,6 @@ jobs:
python-version: ${{ matrix.python-version }}
no-comments: ${{ matrix.python-version != '3.9' || matrix.python-platform != 'Linux' }} # Having each job create the same comment is too noisy.
stubtest-stdlib:
name: Check stdlib with stubtest
runs-on: ${{ matrix.os }}
strategy:
matrix:
# macos-11 does not have tcl/tk installed, needed for stubtesting tkinter
os: ["ubuntu-latest", "windows-latest", "macos-10.15"]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11-dev"]
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Update pip
run: python -m pip install -U pip
- name: Install dependencies
run: pip install $(grep tomli== requirements-tests.txt) $(grep mypy== requirements-tests.txt)
- name: Run stubtest
run: python tests/stubtest_stdlib.py
stubtest-third-party:
name: Check third party stubs with stubtest
runs-on: ubuntu-20.04