技能 编程开发 TwinMind CI 集成

TwinMind CI 集成

v20260311
twinmind-ci-integration
通过在 GitHub Actions 和 GitLab CI 中设置 lint、单元、集成、冒烟等测试流程,实现 TwinMind API 的自动验证与部署准备。
获取技能
274 次下载
概览

TwinMind CI Integration

Contents

Overview

Integrate TwinMind testing and validation into CI/CD pipelines with GitHub Actions workflows, unit tests, integration tests, smoke tests, and GitLab CI configuration.

Prerequisites

  • TwinMind Pro/Enterprise API access
  • CI/CD system (GitHub Actions, GitLab CI, etc.)
  • Test audio samples
  • Secrets management for API keys

Instructions

Step 1: GitHub Actions Workflow

Create a multi-job workflow with lint-and-typecheck, unit-tests, integration-tests (with API key from secrets), api-health-check, and transcription-smoke-test (on main/schedule only).

Step 2: Write Unit Tests

Build Vitest unit tests mocking the TwinMind client. Test correct request formatting, rate limit handling (429 responses), and summary generation response parsing.

Step 3: Write Integration Tests

Create integration tests that use real API keys (from environment variables). Test API health, account access, and actual transcription with configurable test audio URL.

Step 4: Build Smoke Test Script

Create a standalone smoke test runner that checks API health, account access, and optionally transcription. Report pass/fail with duration for each test.

Step 5: GitLab CI Configuration

Set up equivalent GitLab CI with lint, test, integration stages. Use YAML anchors for shared node template. Configure coverage reporting and scheduled runs.

Step 6: Configure Vitest

Set up vitest.config.ts with V8 coverage provider, 30s test timeout, and separate test scripts for unit, integration, and smoke tests.

See detailed implementation for complete GitHub Actions YAML, test files, smoke test runner, and GitLab CI config.

Output

  • GitHub Actions workflow
  • Unit test suite
  • Integration test suite
  • Smoke test script
  • GitLab CI configuration

Error Handling

Issue Cause Solution
Secret not found Not configured Add to GitHub/GitLab Secrets
Test timeout Large audio file Use 10-30 second test samples
Rate limited in CI Too many runs Use dedicated test API key
API unavailable TwinMind outage Add retry logic to tests

Examples

Basic usage: Apply twinmind ci integration to a standard project setup with default configuration options.

Advanced scenario: Customize twinmind ci integration for production environments with multiple constraints and team-specific requirements.

Resources

Next Steps

For deployment integration, see twinmind-deploy-integration.

信息
Category 编程开发
Name twinmind-ci-integration
版本 v20260311
大小 3.79KB
更新时间 2026-03-12
语言