This repository has been archived by the owner on Jan 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
47 lines (44 loc) · 1.58 KB
/
build.yaml
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
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: Build
on:
push:
branches:
- '**'
pull_request:
branches:
- master
schedule:
- cron: "0 22 * * 1"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v1
with:
java-version: 8
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew assemble
- name: Test with Gradle
run: ./gradlew check
- name: Upload coverage report to CodeCov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
file: ./build/reports/jacoco/test/jacocoTestReport.xml # optional
fail_ci_if_error: true # optional (default = false)
verbose: true
- name: Slack notification when master build fails
if: ${{ failure() && github.ref == 'refs/heads/master'}}
uses: rtCamp/[email protected]
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: cerberus-alerts
SLACK_MESSAGE: 'Cerberus Lifecycle CLI main build has failed :build-failed:'
SLACK_ICON: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png
SLACK_TITLE: Cerberus Build Failure Notification
SLACK_USERNAME: GitHub Actions