Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Github Actions CI for the repo - sanity check #102

Merged
merged 87 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
58a0093
CI test
adrianboguszewski Nov 14, 2024
b784697
Update python-app.yml
adrianboguszewski Nov 14, 2024
f20fad3
Update python-app.yml
adrianboguszewski Nov 14, 2024
37cd5bb
Update python-app.yml
adrianboguszewski Nov 14, 2024
7ce282c
Update python-app.yml
adrianboguszewski Nov 14, 2024
146365e
Update python-app.yml
adrianboguszewski Nov 14, 2024
b0554b2
Update python-app.yml
adrianboguszewski Nov 14, 2024
3460472
Update python-app.yml
adrianboguszewski Nov 14, 2024
9e1a4de
Update python-app.yml
adrianboguszewski Nov 14, 2024
41ec7c9
Update python-app.yml
adrianboguszewski Nov 14, 2024
95d4a7e
Update python-app.yml
adrianboguszewski Nov 14, 2024
b833930
Update python-app.yml
adrianboguszewski Nov 14, 2024
92352a8
Update python-app.yml
adrianboguszewski Nov 14, 2024
2942021
Update python-app.yml
adrianboguszewski Nov 14, 2024
3f04933
Update python-app.yml
adrianboguszewski Nov 14, 2024
0a397ff
Update python-app.yml
adrianboguszewski Nov 14, 2024
513f7dd
Update python-app.yml
adrianboguszewski Nov 14, 2024
dcbd7d4
Update python-app.yml
adrianboguszewski Nov 14, 2024
5f6b7aa
Update python-app.yml
adrianboguszewski Nov 14, 2024
f07c703
Update and rename python-app.yml to sanity-check.yml
adrianboguszewski Nov 14, 2024
88cd0e3
Update sanity-check.yml
adrianboguszewski Nov 14, 2024
3c5e4b5
Update sanity-check.yml
adrianboguszewski Nov 14, 2024
4922732
Update sanity-check.yml
adrianboguszewski Nov 14, 2024
59f354c
Update sanity-check.yml
adrianboguszewski Nov 14, 2024
c2ecdc2
Update sanity-check.yml
adrianboguszewski Nov 14, 2024
6d59727
Update sanity-check.yml
adrianboguszewski Nov 14, 2024
cb243da
Update sanity-check.yml
adrianboguszewski Nov 14, 2024
137bf60
Update sanity-check.yml
adrianboguszewski Nov 14, 2024
71d7378
Update sanity-check.yml
adrianboguszewski Nov 14, 2024
da82506
Update sanity-check.yml
adrianboguszewski Nov 15, 2024
f69c27a
Update sanity-check.yml
adrianboguszewski Nov 15, 2024
91d93d6
Update sanity-check.yml
adrianboguszewski Nov 15, 2024
a31716c
Update sanity-check.yml
adrianboguszewski Nov 15, 2024
f882541
Update sanity-check.yml
adrianboguszewski Nov 15, 2024
06146bc
Update sanity-check.yml
adrianboguszewski Nov 15, 2024
c871055
Update sanity-check.yml
adrianboguszewski Nov 15, 2024
e9a4db5
Update sanity-check.yml
adrianboguszewski Nov 15, 2024
e9f6b4b
Update sanity-check.yml
adrianboguszewski Nov 15, 2024
887164e
Update sanity-check.yml
adrianboguszewski Nov 15, 2024
cdd8734
Update sanity-check.yml
adrianboguszewski Nov 15, 2024
7befa76
Update sanity-check.yml
adrianboguszewski Nov 15, 2024
5113b94
Update sanity-check.yml
adrianboguszewski Nov 15, 2024
c8e526d
Update sanity-check.yml
adrianboguszewski Nov 15, 2024
40e873c
Update sanity-check.yml
adrianboguszewski Nov 15, 2024
3effebb
Update sanity-check.yml
adrianboguszewski Nov 15, 2024
4c3456b
Update sanity-check.yml
adrianboguszewski Nov 15, 2024
0b9f32c
Update sanity-check.yml
adrianboguszewski Nov 15, 2024
6b0cac6
Update sanity-check.yml
adrianboguszewski Nov 15, 2024
f55d401
Update sanity-check.yml
adrianboguszewski Nov 15, 2024
54f84ce
Update sanity-check.yml
adrianboguszewski Nov 21, 2024
2b8a8d5
Update sanity-check.yml
adrianboguszewski Nov 21, 2024
e4932da
Update sanity-check.yml
adrianboguszewski Nov 21, 2024
27e88c2
Update sanity-check.yml
adrianboguszewski Nov 21, 2024
b69fe9a
Update sanity-check.yml
adrianboguszewski Nov 21, 2024
5d4cedf
Update sanity-check.yml
adrianboguszewski Nov 21, 2024
c9436cd
Update sanity-check.yml
adrianboguszewski Nov 21, 2024
f433c02
Update sanity-check.yml
adrianboguszewski Nov 21, 2024
99b0e13
Update sanity-check.yml
adrianboguszewski Nov 21, 2024
f70a0e4
Update sanity-check.yml
adrianboguszewski Nov 21, 2024
079cf0a
Update sanity-check.yml
adrianboguszewski Nov 21, 2024
961ad0d
Update sanity-check.yml
adrianboguszewski Nov 21, 2024
ab91b5e
Update sanity-check.yml
adrianboguszewski Nov 21, 2024
7caf02f
Update sanity-check.yml
adrianboguszewski Nov 27, 2024
436df17
Update sanity-check.yml
adrianboguszewski Nov 27, 2024
38306bd
Update sanity-check.yml
adrianboguszewski Nov 27, 2024
dbe82a7
Update sanity-check.yml
adrianboguszewski Nov 27, 2024
d8d872b
Update sanity-check.yml
adrianboguszewski Nov 27, 2024
865413a
Added more yaml configs
adrianboguszewski Nov 27, 2024
10397ca
Update setup-os.yml
adrianboguszewski Nov 27, 2024
a1a9ce3
Update sanity-check.yml
adrianboguszewski Nov 27, 2024
6ea95db
Refactored
adrianboguszewski Nov 27, 2024
fd9c954
Update sanity-check.yml
adrianboguszewski Nov 27, 2024
6be0731
Update action.yml
adrianboguszewski Nov 27, 2024
81dfcc0
Update sanity-check.yml
adrianboguszewski Nov 27, 2024
d9413f5
Update
adrianboguszewski Nov 27, 2024
d0d743c
Update
adrianboguszewski Nov 27, 2024
c80e180
Update
adrianboguszewski Nov 27, 2024
c684ad8
Update
adrianboguszewski Nov 27, 2024
9bcf3a3
Update
adrianboguszewski Nov 27, 2024
b3c572f
Update action.yml
adrianboguszewski Nov 27, 2024
eea2536
Update action.yml
adrianboguszewski Nov 27, 2024
a75f167
Update sanity-check.yml
adrianboguszewski Nov 27, 2024
76b364b
Update sanity-check.yml
adrianboguszewski Nov 27, 2024
495cc0c
Update action.yml
adrianboguszewski Nov 27, 2024
a381f00
Update sanity-check.yml
adrianboguszewski Nov 27, 2024
e84bcf0
Update sanity-check.yml
adrianboguszewski Nov 27, 2024
5129777
Merge branch 'master' into CI
adrianboguszewski Nov 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/reusable-steps/setup-os/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: OS setup

runs:
using: 'composite'
steps:
- name: Install coreutils
if: runner.os == 'macOS'
shell: bash
run: |
brew install coreutils
- name: Install virtual display
if: runner.os == 'Linux'
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y xvfb
29 changes: 29 additions & 0 deletions .github/reusable-steps/setup-python/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Python setup

inputs:
python:
required: true
project:
required: true

runs:
using: 'composite'
steps:
- name: Download sample video file
shell: bash
run: |
cd ${{ inputs.project }}
curl -L -o sample_video.mp4 https://sample-videos.com/video321/mp4/720/big_buck_bunny_720p_1mb.mp4
- name: Set up Python ${{ inputs.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python }}
- name: Install dependencies
shell: bash
run: |
python -m pip install --upgrade pip
pip install -r ${{ inputs.project }}/requirements.txt
- name: List dependencies
shell: bash
run: |
pip list
25 changes: 25 additions & 0 deletions .github/reusable-steps/timeouted-action/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Run action with timeout

inputs:
command:
required: true
project:
required: true
timeout:
required: false
default: 1h

runs:
using: 'composite'
steps:
- name: Run JS Project
shell: bash
run: |
cd ${{ inputs.project }}
# linux requires a virtual display
if [ "${{ runner.os }}" == "Linux" ]; then
# the timeout trick "gracefully" kills the app after specified time (waiting for user input otherwise)
timeout ${{ inputs.timeout }} xvfb-run ${{ inputs.command }} || [[ $? -eq 124 ]]
else
timeout ${{ inputs.timeout }} ${{ inputs.command }} || [[ $? -eq 124 ]]
fi
158 changes: 158 additions & 0 deletions .github/workflows/sanity-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
name: Sanity check

on:
schedule:
- cron: "0 2 * * *"

permissions:
contents: read

jobs:
find-subprojects:
runs-on: ubuntu-latest
outputs:
notebook: ${{ steps.categorize-subprojects.outputs.notebook }}
gradio: ${{ steps.categorize-subprojects.outputs.gradio }}
webcam: ${{ steps.categorize-subprojects.outputs.webcam }}
js: ${{ steps.categorize-subprojects.outputs.js }}
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Categorize subprojects
id: categorize-subprojects
run: |
notebook=()
gradio=()
webcam=()
js=()

for dir in $(find demos -type d -mindepth 1 -maxdepth 1 ! -name utils); do
if [ -f "$dir/package.json" ]; then
js+=("$dir")
elif [ -f "$dir/main.ipynb" ]; then
notebook+=("$dir")
elif grep -q "gradio" "$dir/requirements.txt"; then
gradio+=("$dir")
elif grep -q -- "--stream" "$dir/main.py"; then
webcam+=("$dir")
fi
done

notebook_json=$(printf '%s\n' "${notebook[@]}" | jq -R -s -c 'split("\n")[:-1]')
gradio_json=$(printf '%s\n' "${gradio[@]}" | jq -R -s -c 'split("\n")[:-1]')
webcam_json=$(printf '%s\n' "${webcam[@]}" | jq -R -s -c 'split("\n")[:-1]')
js_json=$(printf '%s\n' "${js[@]}" | jq -R -s -c 'split("\n")[:-1]')

echo "notebook=$notebook_json" | tee -a $GITHUB_OUTPUT
echo "gradio=$gradio_json" | tee -a $GITHUB_OUTPUT
echo "webcam=$webcam_json" | tee -a $GITHUB_OUTPUT
echo "js=$js_json" | tee -a $GITHUB_OUTPUT

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.11]
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 main.ipynb
project: ${{ matrix.subproject }}

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.11]
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/timeouted-action
name: Run Gradio App
with:
command: python main.py
project: ${{ matrix.subproject }}
timeout: 30m

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.11]
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 }}

js:
needs: find-subprojects
if: ${{ needs.find-subprojects.outputs.js != '[]' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
subproject: ${{ fromJson(needs.find-subprojects.outputs.js) }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/reusable-steps/setup-os
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install dependencies
run: |
cd ${{ matrix.subproject }}
npm install
- uses: ./.github/reusable-steps/timeouted-action
name: Run JS Project
with:
command: npm start
project: ${{ matrix.subproject }}
timeout: 1m