chore(tests): accuracy tests for MongoDB tools exposed by MCP server MCP-39 #2
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Accuracy Tests | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: | |
- labeled | |
jobs: | |
run-accuracy-tests: | |
name: Run Accuracy Tests | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
pull-requests: write | |
if: | | |
github.event_name == 'workflow_dispatch' || | |
(github.event_name == 'pull_request' && github.event.label.name == 'accuracy-tests') | |
env: | |
MDB_OPEN_AI_API_KEY: ${{ secrets.ACCURACY_OPEN_AI_API_KEY }} | |
MDB_GEMINI_API_KEY: ${{ secrets.ACCURACY_GEMINI_API_KEY }} | |
MDB_AZURE_OPEN_AI_API_KEY: ${{ secrets.ACCURACY_AZURE_OPEN_AI_API_KEY }} | |
MDB_AZURE_OPEN_AI_API_URL: ${{ secrets.ACCURACY_AZURE_OPEN_AI_API_URL }} | |
MDB_ACCURACY_MDB_URL: ${{ secrets.ACCURACY_MDB_CONNECTION_STRING }} | |
MDB_ACCURACY_BASELINE_COMMIT: ${{ github.event.pull_request.base.sha || '' }} | |
steps: | |
- uses: GitHubSecurityLab/actions-permissions/monitor@v1 | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: package.json | |
cache: "npm" | |
- name: Install dependencies | |
run: npm ci | |
- name: Run accuracy tests | |
run: npm run test:accuracy | |
- name: Upload accuracy test summary | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: accuracy-test-summary | |
path: .accuracy/tests-summary.html | |
- name: Comment summary on PR | |
if: github.event_name == 'pull_request' && github.event.label.name == 'accuracy-tests' | |
uses: marocchino/sticky-pull-request-comment@d2ad0de260ae8b0235ce059e63f2949ba9e05943 # v2 | |
with: | |
path: .accuracy/tests-summary.html |