mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-15 02:11:15 +08:00
547517b74e
* move generate_notebooks.py to scripts folder * generate notebooks * final? fix
67 lines
2.1 KiB
YAML
67 lines
2.1 KiB
YAML
name: "test / hygiene"
|
|
|
|
on:
|
|
workflow_run:
|
|
workflows: ["trigger"]
|
|
types:
|
|
- requested
|
|
|
|
permissions:
|
|
statuses: write
|
|
|
|
concurrency:
|
|
group: "${{ github.event.workflow_run.head_repository.full_name }}-${{ github.event.workflow_run.head_branch }}-${{ github.workflow_ref }}"
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
changes:
|
|
name: "changes"
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
should_run: ${{ steps.changes.outputs.should_run }}
|
|
sha: ${{ steps.changes.outputs.sha }}
|
|
pr_number: ${{ steps.changes.outputs.pr_number }}
|
|
source_branch: ${{ steps.changes.outputs.source_branch }}
|
|
source_repo: ${{ steps.changes.outputs.source_repo }}
|
|
merge_sha: ${{ steps.changes.outputs.merge_sha }}
|
|
mergeable: ${{ steps.changes.outputs.mergeable }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: "gradio-app/gradio/.github/actions/changes@main"
|
|
id: changes
|
|
with:
|
|
type: "all"
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
test-hygiene:
|
|
name: "test-hygiene"
|
|
runs-on: ubuntu-latest
|
|
needs: changes
|
|
if: needs.changes.outputs.should_run == 'true'
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ needs.changes.outputs.merge_sha }}
|
|
repository: ${{ needs.changes.outputs.mergeable == 'true' && github.repository || needs.changes.outputs.source_repo }}
|
|
- name: Generate Notebooks
|
|
run: |
|
|
pip install nbformat && python scripts/generate_notebooks.py
|
|
- name: Print Git Status
|
|
run: echo $(git status) && echo $(git diff)
|
|
- name: Assert Notebooks Match
|
|
run: git status | grep "nothing to commit, working tree clean"
|
|
- name: Check for large files
|
|
uses: actionsdesk/lfs-warning@v3.2
|
|
with:
|
|
filesizelimit: 5MB
|
|
- name: do check
|
|
if: always()
|
|
uses: "gradio-app/github/actions/commit-status@main"
|
|
with:
|
|
type: "all"
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
pr: ${{ needs.changes.outputs.pr_number }}
|
|
sha: ${{ needs.changes.outputs.sha }}
|
|
name: "test / hygiene"
|
|
result: ${{ job.status }}
|
|
job_id: "test-hygiene"
|