stubs #401
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: stubs | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }} | |
cancel-in-progress: true | |
on: # yamllint disable-line rule:truthy | |
pull_request: | |
schedule: | |
- cron: '0 3 * * *' | |
workflow_dispatch: | |
jobs: | |
generate: | |
timeout-minutes: 10 | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Python 3.11 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: Install uv and package | |
run: | | |
python -m pip install --quiet uv | |
uv pip install --quiet --system -e .[stubs] | |
- name: Display system information | |
run: pycrostates-sys_info --developer | |
- name: Generate stub files | |
run: python tools/stubgen.py | |
- name: Push stub files | |
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
if [ -n "$(git status --porcelain)" ]; then | |
git add . | |
git commit -m "deploy stub files [ci skip]" | |
git push | |
fi |