mirror of
https://gitee.com/kekingcn/file-online-preview.git
synced 2026-03-13 20:53:47 +08:00
* test(e2e): expand archive coverage to tar/tgz/7z/rar * test: address copilot archive fixture review feedback * test(e2e): add rar smoke coverage and align archive deps * test(e2e): make tgz fixture gzip header deterministic * test(e2e): keep legacy zip temp dir ignored * test(e2e): address remaining copilot review comments * test(e2e): make 7z fixture generation deterministic and strict * test(e2e): fail fast when sample.rar fixture is missing
101 lines
2.6 KiB
Java
101 lines
2.6 KiB
Java
name: PR E2E MVP
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [master]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
e2e-mvp:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 40
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup JDK 21
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: temurin
|
|
java-version: '21'
|
|
cache: maven
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
cache-dependency-path: tests/e2e/package-lock.json
|
|
|
|
- name: Setup Python 3.11
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.11'
|
|
|
|
- name: Install LibreOffice + archive tools
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libreoffice zip p7zip-full
|
|
|
|
- name: Setup Python deps for office fixtures
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r tests/e2e/requirements.txt
|
|
|
|
- name: Build kkFileView
|
|
run: mvn -q -pl server -DskipTests package
|
|
|
|
- name: Install E2E deps
|
|
working-directory: tests/e2e
|
|
run: |
|
|
npm install
|
|
npx playwright install --with-deps chromium
|
|
|
|
- name: Start fixture server
|
|
run: |
|
|
cd tests/e2e/fixtures
|
|
python3 -m http.server 18080 > /tmp/fixture-server.log 2>&1 &
|
|
|
|
- name: Start kkFileView
|
|
run: |
|
|
JAR_PATH=$(ls server/target/kkFileView-*.jar | head -n 1)
|
|
nohup env KK_TRUST_HOST='*' KK_NOT_TRUST_HOST='10.*,172.16.*,192.168.*' java -jar "$JAR_PATH" > /tmp/kkfileview.log 2>&1 &
|
|
|
|
- name: Wait for services
|
|
run: |
|
|
for i in {1..60}; do
|
|
curl -fsS http://127.0.0.1:18080/sample.txt >/dev/null && break
|
|
sleep 1
|
|
done
|
|
for i in {1..120}; do
|
|
curl -fsS http://127.0.0.1:8012/ >/dev/null && break
|
|
sleep 1
|
|
done
|
|
|
|
- name: Run E2E
|
|
working-directory: tests/e2e
|
|
env:
|
|
KK_BASE_URL: http://127.0.0.1:8012
|
|
FIXTURE_BASE_URL: http://127.0.0.1:18080
|
|
run: npm test
|
|
|
|
- name: Upload Playwright report
|
|
if: always()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: playwright-report
|
|
path: tests/e2e/playwright-report
|
|
|
|
- name: Upload service logs
|
|
if: always()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: e2e-service-logs
|
|
path: |
|
|
/tmp/kkfileview.log
|
|
/tmp/fixture-server.log
|