mirror of
https://github.com/gradio-app/gradio.git
synced 2025-01-06 10:25:17 +08:00
67275ec1d6
* add generate_notebooks and run it * add buttons to demos tab * add buttons to docs * add github check * fix erros * Update run.py * Update run.py * fix github action * add nbformat * wget files from demo directory * testing with regex * typo in github action * cd first * correct notebooks * remove prit * testing * regenerate ids in notebooks * testing action * testing action * testing action * sort files before wget so no git diff * skip DS store and others as sub files * example demo change without notebook change * fixes * example demo change without notebook change * example regenerated notebooks * Update CHANGELOG.md * Update CHANGELOG.md * Update .github/workflows/check-demo-notebooks.yml Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * gh action comments * gh action syntax * gh action syntax fixes * test demo change without generating notebooks * ran the suggested command * remove unnecessary script * add notebook for upload button demo * switch to pull_request_target Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
38 lines
1.3 KiB
YAML
38 lines
1.3 KiB
YAML
# This workflow will check if the run.py files in every demo match the run.ipynb notebooks.
|
|
|
|
name: Check Demos Match Notebooks
|
|
|
|
on:
|
|
pull_request_target:
|
|
types: [opened, synchronize, reopened]
|
|
paths:
|
|
- 'demo/**'
|
|
|
|
jobs:
|
|
check-notebooks:
|
|
name: Generate Notebooks and Check
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.ref }}
|
|
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
|
- name: Generate Notebooks
|
|
run: |
|
|
pip install nbformat && cd demo && python generate_notebooks.py
|
|
- name: Print Git Status
|
|
run: echo $(git status) && echo $(git diff)
|
|
- name: Assert Notebooks Match
|
|
id: assertNotebooksMatch
|
|
run: git status | grep "nothing to commit, working tree clean"
|
|
- name: Comment On PR
|
|
uses: thollander/actions-comment-pull-request@v1
|
|
if: always() && (steps.assertNotebooksMatch.outcome == 'failure')
|
|
with:
|
|
message: |
|
|
The demo notebooks don't match the run.py files. Please run this command from the root of the repo and then commit the changes:
|
|
```bash
|
|
pip install nbformat && cd demo && python generate_notebooks.py
|
|
```
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |