-
Notifications
You must be signed in to change notification settings - Fork 5
86 lines (72 loc) · 2.26 KB
/
run-test.yaml
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Run test
on:
pull_request:
types: [opened, synchronize]
branches:
- develop
- main
permissions:
contents: write
actions: read
checks: write
jobs:
unit_tests:
name: Unit Test
permissions: write-all
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18
cache: npm
- name: Install dependencies
run: npm ci
- name: Run Unit Tests
run: npm run test
- name: Debug
run: ls -la
- name: Debug report
run: ls -la report
- name: Unit Test Report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
with:
name: Unit Tests Reporter # Name of the check run which will be created
path: report/unit.xml # Path to test results
reporter: jest-junit # Format of test results
fail-on-error: 'true' # Set action as failed if test report contains any failed test
e2e_tests:
name: E2e Test For Core package
needs: unit_tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18
cache: npm
- name: Install dependencies
run: npm ci
- name: Build test
run: npx lerna run build:test --scope=@mbc-cqrs-severless/core
- name: Run e2e Tests
run: npx lerna run test:e2e --scope=@mbc-cqrs-severless/core
- uses: actions/upload-artifact@v4
name: 'upload artfact'
if: success() || failure()
with:
name: my-artifacts
path: ./packages/core/test/scripts/*.out.txt
- name: E2E Test Report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
with:
name: E2E Core Tests Reporter # Name of the check run which will be created
path: report/e2e-core.xml # Path to test results
reporter: jest-junit # Format of test results
fail-on-error: 'true' # Set action as failed if test report contains any failed test