-
Notifications
You must be signed in to change notification settings - Fork 5
94 lines (86 loc) · 2.56 KB
/
pull-request.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
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
87
88
89
90
91
92
93
94
name: "Build and Test"
on:
# Run daily at midnight
schedule:
- cron: "0 0 * * *"
# Allow workflow to be manually run from the GitHub UI
workflow_dispatch:
# Allow workflow to be called from other files
workflow_call:
push:
pull_request:
jobs:
unit-tests:
name: "Unit Tests"
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- name: "Checkout Branch"
uses: actions/checkout@v3
with:
token: ${{ secrets.MP_SEMANTIC_RELEASE_BOT }}
repository: ${{github.event.pull_request.head.repo.full_name}}
ref: ${{github.head_ref}}
- name: "Install JDK 11"
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: "11"
cache: "gradle"
- name: "Run Unit Tests"
run: ./gradlew test
- name: "Print Android Unit Tests Report"
uses: asadmansr/android-test-report-action@v1.2.0
if: ${{ always() }}
- name: "Archive Unit Test Results"
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: "unit-tests-results"
path: ./**/build/reports/**
lint-checks:
name: "Lint Checks"
timeout-minutes: 15
runs-on: macos-latest
steps:
- name: "Checkout Branch"
uses: actions/checkout@v3
- name: "Install JDK 11"
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: "11"
cache: "gradle"
- name: "Run Lint"
run: ./gradlew lint
- name: "Archive Lint Test Results"
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: "lint-results"
path: ./**/build/reports/**
kotlin-lint-checks:
name: "Kotlin Lint Checks"
timeout-minutes: 15
runs-on: macos-latest
steps:
- name: "Checkout Branch"
uses: actions/checkout@v3
- name: "Install JDK 11"
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: "11"
cache: "gradle"
- name: "Run Android Core SDK Kotlin Lint"
run: ./gradlew ktlintCheck
- name: "Archive Kotlin Lint Test Results"
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: "kotlin-lint-results"
path: ./**/build/reports/**
automerge-dependabot:
name: "Save PR Number for Dependabot Automerge"
needs: [ unit-tests, lint-checks, kotlin-lint-checks ]
uses: mParticle/mparticle-workflows/.github/workflows/dependabot-save-pr-number.yml@main