-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (39 loc) · 1.19 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
name: Check and build app
on:
push:
branches:
- main
pull_request:
jobs:
check-n-build:
runs-on: ubuntu-latest
steps:
- name: "Checkout repository code"
uses: actions/checkout@v3
- name: "Setup JDK 17"
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
- name: "Setup Gradle"
uses: gradle/[email protected]
- name: "Run build with Gradle wrapper"
id: gradle
run: ./gradlew :build --scan
- name: "Add build scan URL as PR comment"
uses: actions/github-script@v5
if: github.event_name == 'pull_request' && failure()
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '❌ ${{ github.workflow }} failed: ${{ steps.gradle.outputs.build-scan-url }}'
})
- name: "HTLM build reports"
uses: actions/upload-artifact@v3
with:
name: build-reports
path: app/build/reports/*.html