Skip to content

Commit

Permalink
test: ci
Browse files Browse the repository at this point in the history
  • Loading branch information
aiwantaozi committed Nov 22, 2024
1 parent f6bed2a commit d84830e
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 68 deletions.
126 changes: 63 additions & 63 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,76 +11,76 @@ on:
- "**.gif"

jobs:
linux-macos:
timeout-minutes: 20
runs-on: ubuntu-latest
# linux-macos:
# timeout-minutes: 20
# runs-on: ubuntu-latest

strategy:
matrix:
python-version: ["3.11"]
os: [linux, darwin]
steps:
- name: Free Disk Space
if: matrix.os == 'linux'
uses: jlumbroso/free-disk-space@main
with:
android: true
dotnet: true
haskell: true
- uses: actions/checkout@v4
name: Checkout code
# strategy:
# matrix:
# python-version: ["3.11"]
# os: [linux, darwin]
# steps:
# - name: Free Disk Space
# if: matrix.os == 'linux'
# uses: jlumbroso/free-disk-space@main
# with:
# android: true
# dotnet: true
# haskell: true
# - uses: actions/checkout@v4
# name: Checkout code

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
# - name: Set up Python
# uses: actions/setup-python@v5
# with:
# python-version: ${{ matrix.python-version }}

- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/pypoetry/artifacts
~/.cache/pypoetry/repository
~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-poetry-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-${{ matrix.python-version }}-
# - name: Cache dependencies
# uses: actions/cache@v4
# with:
# path: |
# ~/.cache/pypoetry/artifacts
# ~/.cache/pypoetry/repository
# ~/.cache/pypoetry/virtualenvs
# key: ${{ runner.os }}-poetry-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
# restore-keys: |
# ${{ runner.os }}-poetry-${{ matrix.python-version }}-

- name: Run CI build
run: |
df -h
make ci
df -h
env:
BUILD_OS: ${{ matrix.os }}
# - name: Run CI build
# run: |
# df -h
# make ci
# df -h
# env:
# BUILD_OS: ${{ matrix.os }}

- name: Upload wheel as artifact
if: matrix.python-version == '3.11' && matrix.os == 'linux'
uses: actions/upload-artifact@v4
with:
name: speech-dist
path: dist/*.whl
retention-days: 5
# - name: Upload wheel as artifact
# if: matrix.python-version == '3.11' && matrix.os == 'linux'
# uses: actions/upload-artifact@v4
# with:
# name: speech-dist
# path: dist/*.whl
# retention-days: 5

- name: Release GitHub Assets
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/') && matrix.python-version == '3.11' && matrix.os == 'linux'
with:
# Draft for official releases to prepare and review release notes before publishing
draft: ${{ !contains(github.ref, 'rc') }}
fail_on_unmatched_files: true
prerelease: ${{ contains(github.ref, 'rc') }}
files: dist/*.whl
# - name: Release GitHub Assets
# uses: softprops/action-gh-release@v2
# if: startsWith(github.ref, 'refs/tags/') && matrix.python-version == '3.11' && matrix.os == 'linux'
# with:
# # Draft for official releases to prepare and review release notes before publishing
# draft: ${{ !contains(github.ref, 'rc') }}
# fail_on_unmatched_files: true
# prerelease: ${{ contains(github.ref, 'rc') }}
# files: dist/*.whl

- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags/') && matrix.python-version == '3.11' && matrix.os == 'linux'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.CI_PYPI_API_TOKEN }}
TWINE_REPOSITORY: ${{ vars.CI_PYPI_REPOSITORY || '' }}
PUBLISH_SOURCE: ${{ matrix.os == 'linux' && '1' || '' }}
run: |
make publish-pypi
# - name: Publish to PyPI
# if: startsWith(github.ref, 'refs/tags/') && matrix.python-version == '3.11' && matrix.os == 'linux'
# env:
# TWINE_USERNAME: __token__
# TWINE_PASSWORD: ${{ secrets.CI_PYPI_API_TOKEN }}
# TWINE_REPOSITORY: ${{ vars.CI_PYPI_REPOSITORY || '' }}
# PUBLISH_SOURCE: ${{ matrix.os == 'linux' && '1' || '' }}
# run: |
# make publish-pypi

windows-amd64:
timeout-minutes: 20
Expand Down
16 changes: 13 additions & 3 deletions hack/lib/windows/util.ps1
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
$ROOT_DIR = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent | Split-Path -Parent | Split-Path -Parent | Split-Path -Parent -Resolve

function Ignore-Thirdparty-InvalidFile {
$dataFileDir = "$env:ROOT_DIR/vox_box/third_party/CosyVoice/third_party/Matcha-TTS"
$dataFileDir = Join-Path -Path $ROOT_DIR -ChildPath "vox_box/third_party/CosyVoice/third_party/Matcha-TTS"
if (-Not (Test-Path -Path $dataFileDir)) {
Write-Host "Directory $dataFileDir does not exist. Skipping."
return
}

Push-Location -Path $dataFileDir
try {
git update-index --assume-unchanged "data"
Remove-Item -Recurse -Force "data"
if (Test-Path -Path "data") {
git update-index --assume-unchanged "data"
Remove-Item -Recurse -Force "data"
}
else {
Write-Host "File 'data' does not exist. Skipping."
}
}
finally {
Pop-Location
Expand Down
2 changes: 1 addition & 1 deletion hack/windows/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ $ROOT_DIR = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent | Split-
function Build {
$distDir = Join-Path -Path $ROOT_DIR -ChildPath "dist"
Remove-Item -Path $distDir -Recurse -Force -ErrorAction SilentlyContinue

Ignore-Thirdparty-InvalidFile
poetry build
if ($LASTEXITCODE -ne 0) {
Expand Down
2 changes: 1 addition & 1 deletion hack/windows/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function Install-Dependency {
git submodule update --init --recursive

Ignore-Thirdparty-InvalidFile

pip install poetry==1.8.3 pre-commit==4.0.1
if ($LASTEXITCODE -ne 0) {
SpeechBox.Log.Fatal "failed to install poetry."
Expand Down

0 comments on commit d84830e

Please sign in to comment.