-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (45 loc) · 1.3 KB
/
run-unit-test.yml
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
name: Run unit tests
on:
pull_request:
push:
branches:
- "develop"
- "main"
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
permissions:
contents: read
actions: read
checks: write
jobs:
unit-tests:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Prepare Android Environment
uses: ./.github/actions/prepare-android-env
- name: Run test
run: ./gradlew test
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
with:
name: JEST Tests
path: "*/build/test-results/**/*.xml"
reporter: java-junit
- name: Upload failed tests results
if: failure()
uses: actions/upload-artifact@v3
with:
name: failed-tests-results
path: |
*/build/reports/**
- name: Include Slack Notification
if: failure() && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master')
uses: ./.github/actions/slack-notification
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_GIT_REF: ${{ github.ref }}
SLACK_WORKFLOW: ${{ github.workflow }}