4444 - uses : GitHubSecurityLab/actions-permissions/monitor@v1
4545 if : matrix.os != 'windows-latest'
4646 - uses : actions/checkout@v4
47+ - uses : actions/setup-node@v4
48+ with :
49+ node-version-file : package.json
50+ cache : " npm"
51+ - name : Install dependencies
52+ run : npm ci
53+ - name : Run tests
54+ run : npm test
55+ - name : Upload test results
56+ if : matrix.os == 'ubuntu-latest'
57+ uses : actions/upload-artifact@v3
58+ with :
59+ name : test-results
60+ path : coverage/lcov.info
61+
62+ run-atlas-tests :
63+ runs-on : ubuntu-latest
64+ steps :
65+ - uses : GitHubSecurityLab/actions-permissions/monitor@v1
66+ - uses : actions/checkout@v4
4767 - uses : actions/setup-node@v4
4868 with :
4969 node-version-file : package.json
@@ -55,11 +75,38 @@ jobs:
5575 MDB_MCP_API_CLIENT_ID : ${{ secrets.TEST_ATLAS_CLIENT_ID }}
5676 MDB_MCP_API_CLIENT_SECRET : ${{ secrets.TEST_ATLAS_CLIENT_SECRET }}
5777 MDB_MCP_API_BASE_URL : ${{ vars.TEST_ATLAS_BASE_URL }}
58- run : npm test
78+ run : npm test -- --testPathIgnorePatterns "mongodb"
79+ - name : Upload test results
80+ uses : actions/upload-artifact@v3
81+ with :
82+ name : atlas-test-results
83+ path : coverage/lcov.info
84+ coverage :
85+ runs-on : ubuntu-latest
86+ steps :
87+ - uses : actions/checkout@v4
88+ - uses : actions/setup-node@v4
89+ with :
90+ node-version-file : package.json
91+ cache : " npm"
92+ - name : Install dependencies
93+ run : npm ci
94+ - name : Download test results
95+ uses : actions/download-artifact@v4
96+ with :
97+ name : test-results
98+ path : coverage/mongodb
99+ - name : Download atlas test results
100+ uses : actions/download-artifact@v4
101+ with :
102+ name : atlas-test-results
103+ path : coverage/atlas
104+ - name : Merge coverage reports
105+ run : |
106+ lcov-result-merger coverage/mongodb/lcov.info coverage/atlas/lcov.info coverage/lcov.info
59107 - name : Coveralls GitHub Action
60108 uses : coverallsapp/github-action@v2.3.6
61- if : matrix.os == 'ubuntu-latest'
62109 with :
63110 file : coverage/lcov.info
64111 git-branch : ${{ github.head_ref || github.ref_name }}
65- git-commit : ${{ github.event.pull_request.head.sha || github.sha }}
112+ git-commit : ${{ github.event.pull_request.head.sha || github.sha }}
0 commit comments