-
Notifications
You must be signed in to change notification settings - Fork 663
97 lines (84 loc) · 3.1 KB
/
ci-build-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
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
95
96
97
on: [push, pull_request]
jobs:
check_java_latest:
runs-on: ubuntu-latest
name: Java 17
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'zulu'
- name: Gradle cache
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-jdk17-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-jdk17
- name: Compile with Gradle
run: ./gradlew assemble
- name: Slack Notification
uses: 8398a7/action-slack@v3
if: always() && env.SLACK_WEBHOOK_URL
with:
status: custom
job_name: Java 17
author_name: Java 17 Build
fields: workflow,commit,repo,author,took
# see https://action-slack.netlify.app/usecase/02-custom for custom payload info
custom_payload: |
{
attachments: [{
color: '${{ job.status }}' === 'success' ? 'good' : '${{ job.status }}' === 'failure' ? 'danger' : 'warning',
text: `${process.env.AS_WORKFLOW} -- (${process.env.AS_COMMIT}) of ${process.env.AS_REPO}@${{ github.head_ref || github.ref }} by ${process.env.AS_AUTHOR} ${{ job.status }} in ${process.env.AS_TOOK}`,
}]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
check_java11:
runs-on: ubuntu-latest
name: Java 11
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'zulu'
- name: Gradle cache
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-jdk11-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-jdk11
- name: Compile with Gradle
run: ./gradlew assemble
- name: Test
run: ./gradlew check
- name: Code coverage
uses: codecov/codecov-action@v3
- name: Slack Notification
uses: 8398a7/action-slack@v3
if: always() && env.SLACK_WEBHOOK_URL
with:
status: custom
job_name: Java 11
author_name: Java 11 Build/Test
fields: workflow,commit,repo,author,took
# see https://action-slack.netlify.app/usecase/02-custom for custom payload info
custom_payload: |
{
attachments: [{
color: '${{ job.status }}' === 'success' ? 'good' : '${{ job.status }}' === 'failure' ? 'danger' : 'warning',
text: `${process.env.AS_WORKFLOW} -- (${process.env.AS_COMMIT}) of ${process.env.AS_REPO}@${{ github.head_ref || github.ref }} by ${process.env.AS_AUTHOR} ${{ job.status }} in ${process.env.AS_TOOK}`,
}]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}