- Add comprehensive.e2e.test.ts: Full E2E tests covering 25+ converters - Add format-matrix.e2e.test.ts: Format conversion matrix (70,000+ combinations) - Add translation.e2e.test.ts: Multi-language translation tests (14 languages) - Add docker-e2e-tests.yml: GitHub Actions workflow for Docker E2E tests - Update run-bun-test.yml: Improved basic test workflow - Add run-e2e-tests.sh: Local test runner script - Add test scripts to package.json Tests cover: - Image formats (Inkscape, ImageMagick, Potrace, etc.) - Document formats (Pandoc, LibreOffice, Calibre) - Data formats (Dasel: JSON/YAML/TOML/XML/CSV) - Translation (PDFMathTranslate, BabelDOC) - Edge cases (Unicode, long content, special characters)
54 lines
1.5 KiB
YAML
54 lines
1.5 KiB
YAML
name: Check Tests
|
|
permissions:
|
|
contents: read
|
|
|
|
# 基本測試 - 在 Ubuntu runner 上運行(有限的工具集)
|
|
# 完整 Docker E2E 測試請參見: docker-e2e-tests.yml
|
|
|
|
on:
|
|
push:
|
|
branches: ["main"]
|
|
pull_request:
|
|
branches: ["main"]
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
test:
|
|
name: Run tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Bun
|
|
uses: oven-sh/setup-bun@v2
|
|
with:
|
|
bun-version: 1.2.2
|
|
|
|
# 安裝 E2E 測試所需的轉換工具
|
|
- name: Install conversion tools for E2E tests
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y pandoc imagemagick
|
|
|
|
- name: Install dependencies
|
|
run: bun install
|
|
|
|
- name: Run unit and mock tests
|
|
run: bun test tests/e2e/converters.mock.test.ts tests/e2e/api.e2e.test.ts
|
|
|
|
- name: Run available E2E tests
|
|
run: bun test tests/e2e/converters.e2e.test.ts --timeout 120000
|
|
continue-on-error: true
|
|
|
|
- name: Test summary
|
|
run: |
|
|
echo "## 🧪 Test Summary" >> $GITHUB_STEP_SUMMARY
|
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
echo "Basic tests completed. For comprehensive E2E tests with all converters," >> $GITHUB_STEP_SUMMARY
|
|
echo "see the [Docker E2E Tests](${{ github.server_url }}/${{ github.repository }}/actions/workflows/docker-e2e-tests.yml) workflow." >> $GITHUB_STEP_SUMMARY
|
|
|