forked from coursera/metrics-datadog
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (49 loc) · 1.47 KB
/
Copy pathpull-request.yaml
File metadata and controls
59 lines (49 loc) · 1.47 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
name: Test Changes
env:
GRADLE_OPTS: '-Dorg.gradle.daemon=false'
JAVA_VERSION: 11
on:
pull_request:
paths-ignore:
- '*.md'
# All jobs need to be kept in sync with their counterparts in release.yaml
jobs:
build:
name: Build
runs-on: ubuntu-24.04
steps:
- name: Checkout the repo
uses: actions/checkout@v5
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v3
- name: Cache gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Install Java ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v1
with:
java-version: ${{ env.JAVA_VERSION }}
- name: Build project and run tests
run: ./gradlew build check --stacktrace
- name: Bundle the build report
if: failure()
run: |
REPORTS=$(find . -type d -name 'reports')
if [ -n "$REPORTS" ]; then
echo "$REPORTS" | zip -@ -r build-reports.zip
else
echo "No reports directory found; skipping zip."
touch build-reports.zip
fi
- name: Upload the build report
if: failure()
uses: actions/upload-artifact@v4
with:
name: error-report
path: build-reports.zip