fix: update GitHub Actions workflow and Docker configurations for improved functionality

This commit is contained in:
remsky 2025-01-12 21:47:31 -07:00
parent f3ba8ad7f3
commit 396261ccdb
6 changed files with 57 additions and 56 deletions

View file

@ -1,55 +1,55 @@
name: Sync develop with master
# name: Sync develop with master
on:
push:
branches:
- master
# on:
# push:
# branches:
# - master
jobs:
sync-develop:
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: develop
# jobs:
# sync-develop:
# runs-on: ubuntu-latest
# permissions:
# contents: write
# issues: write
# steps:
# - name: Checkout repository
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
# ref: develop
- name: Configure Git
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
# - name: Configure Git
# run: |
# git config user.name "GitHub Actions"
# git config user.email "actions@github.com"
- name: Merge master into develop
run: |
git fetch origin master:master
git merge --no-ff origin/master -m "chore: Merge master into develop branch"
# - name: Merge master into develop
# run: |
# git fetch origin master:master
# git merge --no-ff origin/master -m "chore: Merge master into develop branch"
- name: Push changes
run: |
if ! git push origin develop; then
echo "Failed to push to develop branch"
exit 1
fi
# - name: Push changes
# run: |
# if ! git push origin develop; then
# echo "Failed to push to develop branch"
# exit 1
# fi
- name: Handle Failure
if: failure()
uses: actions/github-script@v7
with:
script: |
const issueBody = `Automatic merge from master to develop failed.
# - name: Handle Failure
# if: failure()
# uses: actions/github-script@v7
# with:
# script: |
# const issueBody = `Automatic merge from master to develop failed.
Please resolve this manually
# Please resolve this manually
Workflow run: ${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`;
# Workflow run: ${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`;
await github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: '🔄 Automatic master to develop merge failed',
body: issueBody,
labels: ['merge-failed', 'automation']
});
# await github.rest.issues.create({
# owner: context.repo.owner,
# repo: context.repo.repo,
# title: '🔄 Automatic master to develop merge failed',
# body: issueBody,
# labels: ['merge-failed', 'automation']
# });

View file

@ -61,10 +61,10 @@ services:
# Gradio UI service [Comment out everything below if you don't need it]
gradio-ui:
image: ghcr.io/remsky/kokoro-fastapi-ui:latest
# image: ghcr.io/remsky/kokoro-fastapi-ui:latest
# Uncomment below (and comment out above) to build from source instead of using the released image
# build:
# context: ./ui
build:
context: ./ui
ports:
- "7860:7860"
volumes:

View file

@ -8,8 +8,6 @@ services:
working_dir: /app/Kokoro-82M
command: >
sh -c "
mkdir -p /app/Kokoro-82M;
cd /app/Kokoro-82M;
if [ \"$$SKIP_MODEL_FETCH\" = \"true\" ]; then
echo 'Skipping model fetch...' && touch .cloned;
else

View file

@ -21,7 +21,7 @@ def create_model_column(voice_ids: Optional[list] = None) -> Tuple[gr.Column, di
voice_input = gr.Dropdown(
choices=voice_ids,
label="Voice",
value=None, # Start with no value to avoid errors
value=voice_ids[0] if voice_ids else None, # Set default value to first item if available
interactive=True,
allow_custom_value=True, # Allow temporary values during updates
)

View file

@ -12,12 +12,16 @@ def create_output_column() -> Tuple[gr.Column, dict]:
audio_output = gr.Audio(label="Generated Speech", type="filepath")
gr.Markdown("### Generated Files")
# Initialize dropdown with empty choices first
output_files = gr.Dropdown(
label="Previous Outputs",
choices=files.list_output_files(),
choices=[],
value=None,
allow_custom_value=True,
interactive=True,
)
# Then update choices after component creation
output_files.choices = files.list_output_files()
play_btn = gr.Button("▶️ Play Selected", size="sm")
@ -40,4 +44,3 @@ def create_output_column() -> Tuple[gr.Column, dict]:
}
return col, components
return col, components

View file

@ -54,7 +54,7 @@ def test_model_column_default_values():
def test_model_column_no_voices():
"""Test model column creation with no voice IDs"""
_, components = create_model_column()
_, components = create_model_column([])
assert components["voice"].choices == []
assert components["voice"].value is None
@ -96,7 +96,7 @@ def test_output_column_configuration():
# Test output files dropdown
assert components["output_files"].label == "Previous Outputs"
assert components["output_files"].allow_custom_value is False
assert components["output_files"].allow_custom_value is True
# Test play button
assert components["play_btn"].value == "▶️ Play Selected"