-
Notifications
You must be signed in to change notification settings - Fork 3
50 lines (48 loc) · 1.47 KB
/
ci.yml
File metadata and controls
50 lines (48 loc) · 1.47 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
name: Unit-Test-CI
on:
push:
branches: [ master, staging, development ]
pull_request:
branches: [ master, staging, development ]
jobs:
build-test:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
checks: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: '22.x'
- run: npm ci
- name: Download regions.json
run: |
mkdir -p dist/lib
npm run download-regions
if [ ! -f dist/lib/regions.json ]; then
echo "Error: regions.json was not downloaded successfully"
exit 1
fi
- uses: ArtiomTr/jest-coverage-report-action@v2
id: coverage-utils-js
continue-on-error: true
with:
output: comment, report-markdown
test-script: npm test
- uses: marocchino/sticky-pull-request-comment@v2
continue-on-error: true
if: steps.coverage-utils-js.outputs.report != ''
with:
header: Contentstack Utils JS Coverage
recreate: true
message: ${{ steps.coverage-utils-js.outputs.report }}
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: JEST Tests
path: reports/junit/jest-*.xml
reporter: jest-junit
fail-on-error: true