From e2cf6c21d5e99d82fb85b623cf5d7d1f948e6146 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Fri, 20 May 2022 15:56:29 +0100 Subject: [PATCH] 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 --- .github/workflows/stubtest_stdlib.yml | 43 +++++++++++++++++++++++++++ .github/workflows/tests.yml | 23 -------------- 2 files changed, 43 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/stubtest_stdlib.yml diff --git a/.github/workflows/stubtest_stdlib.yml b/.github/workflows/stubtest_stdlib.yml new file mode 100644 index 000000000..bc83a52c4 --- /dev/null +++ b/.github/workflows/stubtest_stdlib.yml @@ -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 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 54b2c8709..f073e1830 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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