Add a cron job for testing third-party typing_extensions users #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test third-party users of typing_extensions | ||
on: | ||
schedule: | ||
- cron: "0 0 * * *" # Midnight UTC | ||
pull_request: | ||
paths: | ||
- ".github/workflows/daily.yml" | ||
workflow_dispatch: | ||
permissions: | ||
contents: read | ||
env: | ||
PIP_DISABLE_PIP_VERSION_CHECK: 1 | ||
FORCE_COLOR: 1 | ||
jobs: | ||
pydantic: | ||
name: Run pydantic tests | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout pydantic | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: pydantic/pydantic | ||
- name: Checkout typing_extensions | ||
uses: actions/checkout@v3 | ||
with: | ||
path: typing-extensions-latest | ||
- name: Setup pdm for pydantic tests | ||
uses: pdm-project/setup-pdm@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: true | ||
- name: Install pydantic test dependencies | ||
run: pdm install -G testing -G email | ||
- name: Install typing_extensions latest | ||
run: pip install ./typing-extensions-latest | ||
- name: List installed dependencies | ||
run: pdm list -vv # pdm equivalent to `pip list` | ||
- name: Run pydantic tests | ||
run: pdm run pytest | ||
typing_inspect: | ||
name: Run typing_inspect tests | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout typing_inspect | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: ilevkivskyi/typing_inspect | ||
- name: Checkout typing_extensions | ||
uses: actions/checkout@v3 | ||
with: | ||
path: typing-extensions-latest | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install typing_inspect test dependencies | ||
run: pip install -r test-requirements.txt | ||
- name: Install typing_extensions latest | ||
run: pip install ./typing-extensions-latest | ||
- name: List all installed dependencies | ||
run: pip freeze --all | ||
- name: Run typing_extensions tests | ||
run: pytest | ||
pyanalyze: | ||
name: Run pyanalyze tests | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out pyanalyze | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: quora/pyanalyze | ||
- name: Checkout typing_extensions | ||
uses: actions/checkout@v3 | ||
with: | ||
path: typing-extensions-latest | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install test requirements | ||
run: | | ||
pip install . | ||
pip install pytest mypy_extensions attrs | ||
- name: Install typing_extensions latest | ||
run: pip install ./typing-extensions-latest | ||
- name: List all installed dependencies | ||
run: pip freeze --all | ||
- name: Run tests | ||
run: pytest pyanalyze/ | ||
typeguard: | ||
name: Run typeguard tests | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out typeguard | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: agronholm/typeguard | ||
- name: Checkout typing_extensions | ||
uses: actions/checkout@v3 | ||
with: | ||
path: typing-extensions-latest | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install test requirements | ||
run: pip install -e .[test] | ||
- name: Install typing_extensions latest | ||
run: pip install ./typing-extensions-latest | ||
- name: List all installed dependencies | ||
run: pip freeze --all | ||
- name: Run tests | ||
run: pytest | ||
typed-argument-parser: | ||
name: Run typed-argument-parser tests | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out typed-argument-parser | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: swansonk14/typed-argument-parser | ||
- name: Checkout typing_extensions | ||
uses: actions/checkout@v3 | ||
with: | ||
path: typing-extensions-latest | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install test requirements | ||
run: | | ||
pip install -e . | ||
pip install pytest | ||
- name: Install typing_extensions latest | ||
run: pip install ./typing-extensions-latest | ||
- name: List all installed dependencies | ||
run: pip freeze --all | ||
- name: Run tests | ||
run: pytest | ||
stubtest | ||
name: Run stubtest tests | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout mypy for stubtest tests | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: python/mypy | ||
- name: Checkout typing_extensions | ||
uses: actions/checkout@v3 | ||
with: | ||
path: typing-extensions-latest | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install test requirements | ||
run: | | ||
pip install -r test-requirements.txt | ||
pip install -e . | ||
- name: Install typing_extensions latest | ||
run: pip install ./typing-extensions-latest | ||
- name: List all installed dependencies | ||
run: pip freeze --all | ||
- name: Run tests | ||
run: pytest ./mypy/test/teststubtest.py | ||
create-issue-on-failure: | ||
name: Create an issue if daily tests failed | ||
runs-on: ubuntu-latest | ||
needs: | ||
- pydantic | ||
- typing_inspect | ||
- pyanalyze | ||
- typeguard | ||
- typed-argument-parser | ||
- stubtest | ||
if: | | ||
${{ github.repository == 'python/typing_extensions' | ||
&& always() | ||
&& github.event_name == 'schedule' | ||
&& (needs.pydantic.result == 'failure' | ||
|| needs.typing_inspect.result == 'failure' | ||
|| needs.pyanalyze.result == 'failure' | ||
|| needs.typeguard.result == 'failure' | ||
|| needs.typed-argument-parser.result == 'failure' | ||
|| needs.stubtest.result == 'failure') }} | ||
permissions: | ||
issues: write | ||
steps: | ||
- uses: actions/github-script@v6 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
await github.rest.issues.create({ | ||
owner: "python", | ||
repo: "typing_extensions", | ||
title: `Daily tests failed on ${new Date().toDateString()}`, | ||
body: "Runs listed here: https://github.com/python/typing_extensions/actions/workflows/daily.yml", | ||
}) |