Merge remote-tracking branch 'origin/master' #410
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: Sanity check (AI ref kits) | |
on: | |
schedule: | |
- cron: "0 2 * * *" | |
pull_request: | |
branches: [master] | |
push: | |
branches: [master] | |
workflow_dispatch: | |
permissions: | |
contents: read | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
find-subprojects: | |
runs-on: ubuntu-latest | |
outputs: | |
qt: ${{ steps.categorize-subprojects.outputs.qt }} | |
gradio: ${{ steps.categorize-subprojects.outputs.gradio }} | |
webcam: ${{ steps.categorize-subprojects.outputs.webcam }} | |
python: ${{ steps.categorize-subprojects.outputs.python }} | |
notebook: ${{ steps.categorize-subprojects.outputs.notebook }} | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Determine subprojects to test | |
id: find-updates | |
uses: ./.github/reusable-steps/find-updates | |
with: | |
dir: ai_ref_kits | |
ci_config_file: sanity-check-kits.yml | |
- name: Categorize subprojects | |
id: categorize-subprojects | |
uses: ./.github/reusable-steps/categorize-projects | |
with: | |
subprojects: ${{ steps.find-updates.outputs.subproject_dirs }} | |
qt: | |
needs: find-subprojects | |
if: ${{ needs.find-subprojects.outputs.qt != '[]' }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
python: ["3.10", "3.12"] | |
subproject: ${{ fromJson(needs.find-subprojects.outputs.qt) }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/reusable-steps/setup-os | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- uses: ./.github/reusable-steps/setup-python | |
with: | |
python: ${{ matrix.python }} | |
project: ${{ matrix.subproject }} | |
- name: Login to HF | |
shell: bash | |
run: | | |
huggingface-cli login --token ${{ secrets.HF_TOKEN }} | |
- uses: ./.github/reusable-steps/gradio-action | |
with: | |
script: main.py | |
project: ${{ matrix.subproject }} | |
timeout: 3600 | |
gradio: | |
needs: find-subprojects | |
if: ${{ needs.find-subprojects.outputs.gradio != '[]' }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
python: ["3.10", "3.12"] | |
subproject: ${{ fromJson(needs.find-subprojects.outputs.gradio) }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/reusable-steps/setup-os | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- uses: ./.github/reusable-steps/setup-python | |
with: | |
python: ${{ matrix.python }} | |
project: ${{ matrix.subproject }} | |
- name: Login to HF | |
shell: bash | |
run: | | |
huggingface-cli login --token ${{ secrets.HF_TOKEN }} | |
- uses: ./.github/reusable-steps/gradio-action | |
with: | |
script: main.py | |
project: ${{ matrix.subproject }} | |
timeout: 3600 | |
webcam: | |
needs: find-subprojects | |
if: ${{ needs.find-subprojects.outputs.webcam != '[]' }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
python: ["3.9", "3.12"] | |
subproject: ${{ fromJson(needs.find-subprojects.outputs.webcam) }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/reusable-steps/setup-os | |
- uses: ./.github/reusable-steps/setup-python | |
with: | |
python: ${{ matrix.python }} | |
project: ${{ matrix.subproject }} | |
- uses: ./.github/reusable-steps/timeouted-action | |
name: Run Webcam Demo | |
with: | |
command: python main.py --stream sample_video.mp4 | |
project: ${{ matrix.subproject }} | |
python: | |
needs: find-subprojects | |
if: ${{ needs.find-subprojects.outputs.python != '[]' }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
python: ["3.9", "3.12"] | |
subproject: ${{ fromJson(needs.find-subprojects.outputs.python) }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/reusable-steps/setup-os | |
- uses: ./.github/reusable-steps/setup-python | |
with: | |
python: ${{ matrix.python }} | |
project: ${{ matrix.subproject }} | |
- uses: ./.github/reusable-steps/timeouted-action | |
name: Run Python | |
with: | |
command: python main.py | |
project: ${{ matrix.subproject }} | |
notebook: | |
needs: find-subprojects | |
if: ${{ needs.find-subprojects.outputs.notebook != '[]' }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
python: ["3.10", "3.12"] | |
subproject: ${{ fromJson(needs.find-subprojects.outputs.notebook) }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/reusable-steps/setup-os | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- uses: ./.github/reusable-steps/setup-python | |
with: | |
python: ${{ matrix.python }} | |
project: ${{ matrix.subproject }} | |
- uses: ./.github/reusable-steps/timeouted-action | |
name: Run Notebook | |
with: | |
command: jupyter nbconvert --to notebook --execute *.ipynb | |
project: ${{ matrix.subproject }} |