forked from mongodb/docs-sample-apps
-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (60 loc) · 1.83 KB
/
run-express-tests.yml
File metadata and controls
70 lines (60 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Run Express Tests
on:
pull_request_target:
branches:
- development
paths:
- 'server/js-express/**'
push:
branches:
- development
paths:
- 'server/js-express/**'
jobs:
test:
name: Run Express Tests
runs-on: ubuntu-latest
# Require manual approval for fork PRs
environment: testing
defaults:
run:
working-directory: server/js-express
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: npm install
- name: Run unit tests
run: npm run test:unit -- --json --outputFile=test-results-unit.json || true
env:
MONGODB_URI: ${{ secrets.MFLIX_URI }}
- name: Run integration tests
run: npm run test:integration -- --json --outputFile=test-results-integration.json || true
env:
MONGODB_URI: ${{ secrets.MFLIX_URI }}
ENABLE_SEARCH_TESTS: true
VOYAGE_API_KEY: ${{ secrets.VOYAGE_AI }}
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: |
server/js-express/coverage/
server/js-express/test-results-unit.json
server/js-express/test-results-integration.json
retention-days: 30
- name: Generate Test Summary
if: always()
working-directory: .
run: |
chmod +x .github/scripts/generate-test-summary-jest.sh
.github/scripts/generate-test-summary-jest.sh \
server/js-express/test-results-unit.json \
server/js-express/test-results-integration.json