From 526f9ff236d07f3468b22a32d48300db7c4111ea Mon Sep 17 00:00:00 2001 From: PEI-YING-CHEN Date: Fri, 26 Sep 2025 14:59:24 -0400 Subject: [PATCH] Add smoke test script and GitHub Actions workflow --- .github/workflows/smoke-test.yml | 28 ++++++++++++++++++++++++++++ tests/smoke.sh | 11 +++++++++++ 2 files changed, 39 insertions(+) create mode 100644 .github/workflows/smoke-test.yml create mode 100644 tests/smoke.sh diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml new file mode 100644 index 0000000..ea335cf --- /dev/null +++ b/.github/workflows/smoke-test.yml @@ -0,0 +1,28 @@ +name: Smoke Test # Name of the workflow, shown in GitHub Actions tab + +on: + pull_request: # Trigger workflow when a pull request is created/updated + branches: + - develop # Run workflow only if PR targets the 'develop' branch + - main # Or if PR targets the 'main' branch + +jobs: + smoke-test: + runs-on: ubuntu-latest # Run the job on the latest Ubuntu runner provided by GitHub + + steps: + - name: Checkout repository # Fetch the repository code + uses: actions/checkout@v4 # Use the official GitHub Action to check out code + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.10' + + - name: Install dependencies # Install project dependencies + run: | + pip install -r requirements.txt # Install packages listed in requirements.txt + pip install dvc[s3] # Install DVC with S3 support (change to dvc[gdrive] or dvc[azure] if needed) + + - name: Run smoke test # Execute smoke test script + run: bash tests/smoke.sh # Run the smoke.sh diff --git a/tests/smoke.sh b/tests/smoke.sh new file mode 100644 index 0000000..b63bcb0 --- /dev/null +++ b/tests/smoke.sh @@ -0,0 +1,11 @@ +set -e # when error then stop + +echo "🚀 Running DVC smoke test..." + +# 1. run pipeline +dvc repro --pull --force || { echo "❌ DVC pipeline failed"; exit 1; } + +# 2. validate pipeline (at least one *_docling.json exist) +ls data/parsed/docling_or_fallback/*_docling.json >/dev/null 2>&1 || { echo "❌ No parsed outputs found"; exit 1; } + +echo "✅ Smoke test passed"