Skip to content

Check requirements #1029

Check requirements

Check requirements #1029

name: Check requirements
on:
push:
branches: main
paths:
- ".github/workflows/check-requirements.yml"
- "pyproject.toml"
pull_request:
paths:
- ".github/workflows/check-requirements.yml"
- "pyproject.toml"
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
permissions:
contents: read
env:
FORCE_COLOR: 1 # Request colored output from CLI tools supporting it
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
check-requirements:
name: Check requirements can all be installed together
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Check requirements can all be installed together
run: uv pip install -e '.[dev]' --system
create-issue-on-failure:
name: Create an issue if daily requirements check failed
runs-on: ubuntu-latest
needs: check-requirements
if: >-
${{
github.repository == 'AlexWaygood/typeshed-stats'
&& always()
&& github.event_name == 'schedule'
&& needs.check-requirements.result == 'failure'
}}
permissions:
issues: write
steps:
- uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
await github.rest.issues.create({
owner: "AlexWaygood",
repo: "typeshed-stats",
title: `Daily requirements check failed on ${new Date().toDateString()}`,
body: "Runs are listed here: https://github.com/AlexWaygood/typeshed-stats/actions/workflows/check-requirements.yml",
})