Skip to content

deps: migrate from bincode to postcard for serialization (#133) #498

deps: migrate from bincode to postcard for serialization (#133)

deps: migrate from bincode to postcard for serialization (#133) #498

Workflow file for this run

name: CI
on:
pull_request:
push:
branches: [ main ]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
actions: write
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
changes:
name: Detect changed paths
runs-on: ubuntu-latest
outputs:
build: ${{ steps.filter.outputs.build }}
modeling: ${{ steps.filter.outputs.modeling }}
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Check for path changes
id: filter
uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
with:
filters: |
build:
- 'src/**'
- 'Cargo.toml'
- 'Cargo.lock'
- 'flake.nix'
- 'flake.lock'
- '.github/workflows/ci.yml'
modeling:
- 'modeling/**'
build-and-test:
name: Build & Test (Apple Silicon)
needs: changes
if: >-
needs.changes.outputs.build == 'true' ||
github.event_name == 'push' ||
github.event_name == 'workflow_dispatch'
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install Nix with cache
uses: cachix/install-nix-action@616559265b40713947b9c190a8ff4b507b5df49b # v31.10.4
with:
nix_path: nixpkgs=channel:nixos-unstable
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Cachix
uses: cachix/cachix-action@1eb2ef646ac0255473d23a5907ad7b04ce94065c # v17
continue-on-error: true # cachix daemon stop returns exit 1 on cleanup
with:
name: voicevox-cli
extraPullNames: nix-community
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Cache Nix store
uses: nix-community/cache-nix-action@7df957e333c1e5da7721f60227dbba6d06080569 # v7
with:
primary-key: nix-${{ runner.os }}-${{ hashFiles('flake.lock', 'Cargo.lock') }}
restore-prefixes-first-match: |
nix-${{ runner.os }}-
gc-max-store-size-macos: 5G
purge: ${{ github.event_name == 'push' }}
purge-prefixes: nix-${{ runner.os }}-
purge-last-accessed: 604800
- name: Run Nix flake checks
run: nix flake check --accept-flake-config --show-trace
- name: Build with Nix
run: nix build --accept-flake-config --show-trace
- name: Run security audit
run: |
# RUSTSEC-2026-0009: time crate DoS via stack exhaustion (transitive dep from voicevox_core, awaiting upstream fix)
nix develop --accept-flake-config --command cargo audit --ignore RUSTSEC-2026-0009
- name: Verify build artifacts
run: |
test -d result/bin
test -x result/bin/voicevox-say
test -x result/bin/voicevox-daemon
test -x result/bin/voicevox-mcp-server
test -x result/bin/voicevox-setup
echo "All build artifacts verified"
- name: Test functionality
run: |
result/bin/voicevox-say --help
result/bin/voicevox-daemon --help
result/bin/voicevox-mcp-server --help
result/bin/voicevox-setup --help
- name: Warm up cache (main branch only)
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
run: |
nix-store -qR ./result | cachix push voicevox-cli
tla-model-check:
name: TLA+ Model Checking
needs: changes
if: >-
needs.changes.outputs.modeling == 'true' ||
github.event_name == 'push' ||
github.event_name == 'workflow_dispatch'
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install Nix with cache
uses: cachix/install-nix-action@616559265b40713947b9c190a8ff4b507b5df49b # v31.10.4
with:
nix_path: nixpkgs=channel:nixos-unstable
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Run TLA+ model checking
run: |
nix develop --accept-flake-config --command bash -c '
set -euo pipefail
check() {
echo "::group::$1"
tlc -config "modeling/cfg/$1.cfg" "modeling/tla/$2.tla"
echo "::endgroup::"
}
# Startup and readiness
check Daemon.startup Daemon
check FirstStartup.bootstrap StartupResources
check ONNXRuntime.load ONNXRuntime
check VoicevoxModel.standard VoicevoxModel
check Dictionary.load Dictionary
check Socket.bind Socket
# Client and IPC
check MCPServer.connect MCPServer
check MCPServer.degraded MCPServer
check IPC.safety IPC
check IPC.progress IPC
# Synthesis
check Synthesis.full Synthesis
check Synthesis.normal-flow Synthesis
check Synthesis.invalid-target Synthesis
check Synthesis.progress Synthesis
check Synthesis.retry-boundary Synthesis
check Synthesis.cancel-sources Synthesis
check SynthesisParallel.safety SynthesisParallel
check SynthesisParallel.progress SynthesisParallel
# Playback and integrated system
check Playback.standard Playback
check Say.standard Say
check Say.daemon Say
check System.integration System
echo "All 22 TLA+ scenarios passed"
'