From 95acac787790f3e77a5418d275d41ea0b276e402 Mon Sep 17 00:00:00 2001 From: Nan Jiang Date: Fri, 24 Jan 2025 10:35:42 -0500 Subject: [PATCH] add integration tests --- .github/workflows/ci.yaml | 62 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 58 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 30b0c9b2..4499359d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -13,7 +13,7 @@ jobs: with: python-version: "3.12" cache: "poetry" - - name: Run code linting + - name: Run Code Linting run: make -k lint unit-tests: runs-on: ubuntu-latest @@ -25,14 +25,68 @@ jobs: with: python-version: "3.12" cache: "poetry" - - name: Create workspace + - name: Create Workspace run: mkdir -p workspace - name: Run unit tests run: make unit-tests env: TEST_RESULTS_DIR: workspace/test-results - - name: Generate test coverage + - name: Generate Test Coverage run: make coverage-unit - uses: actions/upload-artifact@v4 + name: unit-test-results with: - path: workspace/test-results/ + path: | + workspace/test-results + integration-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install poetry + run: pipx install poetry + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: "poetry" + - name: Create Workspace + run: mkdir -p workspace + - name: Run Integration Tests + run: make integration-tests + env: + TEST_RESULTS_DIR: workspace/test-results + - name: Generate Test Coverage + run: make coverage-integration + - uses: actions/upload-artifact@v4 + name: integration-test-results + with: + path: | + workspace/test-results + test-coverage-checks: + needs: [unit-tests, integration-tests] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install poetry + run: pipx install poetry + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: "poetry" + - name: Create Workspace + run: mkdir -p workspace + - name: Download All Artifacts + uses: actions/download-artifact@v4 + with: + path: workspace + merge-multiple: true + - name: Evaluate Minimum Test Coverage + run: make test-coverage-check + env: + TEST_RESULTS_DIR: workspace/test-results + - name: Generate Coverage + run: make coverage-combined + - uses: actions/upload-artifact@v4 + name: overall-test-coverage + with: + path: | + workspace/test-results/coverage.json