Skip to content

feat!: add wan-2.2 model support to image-to-video and text-to-video apis #317

feat!: add wan-2.2 model support to image-to-video and text-to-video apis

feat!: add wan-2.2 model support to image-to-video and text-to-video apis #317

Workflow file for this run

# This workflow will test the python package against Sideko's Mock Servers
# Tests will run automatically on a push to `main` or a pull request event
name: pytest
on:
push:
branches:
- main
pull_request: {}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
steps:
#----------------------------------------------
# ----- checkout & setup python -----
#----------------------------------------------
- name: checkout repository
uses: actions/checkout@v4
- name: setup python
uses: actions/setup-python@v5
id: setup-python
with:
python-version: ${{ matrix.python-version }}
#----------------------------------------------
# ----- install & configure poetry -----
#----------------------------------------------
- name: install poetry
uses: snok/install-poetry@v1
with:
version: "1.8.5"
virtualenvs-create: true
virtualenvs-in-project: true
virtualenvs-path: .venv
installer-parallel: true
#---------------------------------------------------
# ----- load cached venv if cache exists -----
#---------------------------------------------------
- name: load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
#---------------------------------------------------------------
# ----- install dependencies if cache does not exist -----
#---------------------------------------------------------------
- name: install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
#-----------------------------------------------------------
# ----- install your root project, if required -----
#-----------------------------------------------------------
- name: install project
run: poetry install --no-interaction
#------------------------------
# ----- run pytest -----
#------------------------------
- name: run pytest
run: |
source .venv/bin/activate
pytest -s
#------------------------------
# ----- run mypy -----
#------------------------------
- name: run mypy
run: |
source .venv/bin/activate
mypy $(poetry version | cut -d' ' -f1)
check-generate-create-sync:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: checkout repository
uses: actions/checkout@v4
- name: setup python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: check generate/create parameter sync
id: sync-check
run: |
if python codemod/check_generate_create_sync.py --quiet; then
echo "in_sync=true" >> $GITHUB_OUTPUT
else
echo "in_sync=false" >> $GITHUB_OUTPUT
python codemod/check_generate_create_sync.py --fix > sync-check-output.txt 2>&1 || true
echo "## Parameter Sync Check Failed" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
cat sync-check-output.txt >> $GITHUB_STEP_SUMMARY
fi
- name: comment on PR
if: github.event_name == 'pull_request' && steps.sync-check.outputs.in_sync == 'false'
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const output = fs.readFileSync('sync-check-output.txt', 'utf8');
const body = `## ⚠️ Parameter Sync Check Failed
The \`generate()\` methods are missing parameters that exist in \`create()\` methods.
\`\`\`
${output}
\`\`\`
**How to fix:** Add the missing parameters to the \`generate()\` method signature and forward them to \`self.create()\`.
`;
// Check if we already commented
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
});
const existingComment = comments.find(c =>
c.user.type === 'Bot' && c.body.includes('Parameter Sync Check Failed')
);
if (existingComment) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: existingComment.id,
body: body
});
} else {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: body
});
}
- name: fail if not in sync
if: steps.sync-check.outputs.in_sync == 'false'
run: exit 1