Set up text encoder tests to work with pytest and Github Actions (#302)

Co-authored-by: kevin314 <kevin.lin.cs1@gmail.com>
This commit is contained in:
Kevin Lin
2025-04-01 17:56:21 -07:00
committed by GitHub
co-authored by kevin314
parent 1fee098f10
commit 708201f531
14 changed files with 385 additions and 168 deletions
+53
View File
@@ -0,0 +1,53 @@
name: PR Test
on:
push:
branches: [main]
pull_request:
branches: [main]
types: [opened, ready_for_review, synchronize, reopened]
concurrency:
group: pr-test-${{ github.ref }}
cancel-in-progress: true
jobs:
unit-test:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
environment: runpod-runners
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Set up SSH key
run: |
mkdir -p ~/.ssh
echo "${{ secrets.RUNPOD_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub
- name: Install dependencies
run: pip install requests
- name: Run tests on RunPod
env:
RUNPOD_API_KEY: ${{ secrets.RUNPOD_API_KEY }}
GITHUB_SHA: ${{ github.sha }}
GITHUB_REF: ${{ github.ref }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_RUN_ID: ${{ github.run_id }}
run: >-
python .github/scripts/runpod_api.py
--gpu-type "NVIDIA A40"
--gpu-count 1
--volume-size 100
--test-command "./env_setup.sh &&
pip install vllm &&
pip install pytest &&
pytest ./fastvideo/v1/tests/ --ignore=./fastvideo/v1/tests/old_tests/ -s"