-
Notifications
You must be signed in to change notification settings - Fork 48
120 lines (113 loc) · 3.7 KB
/
sanity-check-kits.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
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:
gradio: ${{ steps.categorize-subprojects.outputs.gradio }}
webcam: ${{ steps.categorize-subprojects.outputs.webcam }}
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 }}
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 }}
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 }}
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.9", "3.12"]
subproject: ${{ fromJson(needs.find-subprojects.outputs.notebook) }}
steps:
- uses: actions/checkout@v4
- 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 }}