-
Notifications
You must be signed in to change notification settings - Fork 2
73 lines (63 loc) · 1.84 KB
/
test-dev.yml
File metadata and controls
73 lines (63 loc) · 1.84 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
71
72
73
name: Development Build Testing
on:
push:
branches:
- dev
pull_request:
types:
- opened
- synchronize
- reopened
workflow_dispatch:
permissions:
contents: read
concurrency:
group: test-dev-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
if: |
(github.event_name == 'push' && github.actor != 'dependabot[bot]') ||
(github.event_name == 'pull_request' && github.actor == 'dependabot[bot]') ||
github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: "21"
distribution: "temurin"
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Run Unit Tests
run: ./gradlew testDebugUnitTest --no-daemon
continue-on-error: false
- name: Run Lint
run: ./gradlew lintRelease --no-daemon
continue-on-error: false
- name: Build Release
if: github.event_name == 'pull_request' && github.actor == 'dependabot[bot]'
run: ./gradlew assembleRelease --no-daemon
continue-on-error: false
automerge:
needs: [test]
if: >
github.event_name == 'pull_request' &&
github.event.pull_request.user.login == 'dependabot[bot]' &&
needs.test.result == 'success'
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
steps:
- name: Enable auto-merge for Dependabot PRs
uses: peter-evans/enable-pull-request-automerge@v3
with:
token: ${{ github.token }}
pull-request-number: ${{ github.event.pull_request.number }}
merge-method: merge