-
Notifications
You must be signed in to change notification settings - Fork 5
58 lines (55 loc) · 1.63 KB
/
Backend_CI.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
name: Backend_CI
on:
pull_request:
branches:
- master
- dev
jobs:
backend:
name: CI with Gradle
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: iam
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Build with Gradle
run: |
chmod +x ./gradlew
./gradlew build
- name: If failure then upload test reports
if: failure()
run: |
TARBALL_BASENAME="r6-stats-report"
TARBALL="$TARBALL_BASENAME.tar"
echo 'Collecting the test report'
find . -path '*/build/reports/tests' -type d \
-exec tar rf "$TARBALL" \
--xform="s:./:$TARBALL_BASENAME/:" \
--xform='s:/build/reports/tests::' \
{} ';'
echo 'Compressing the test reports .. '
gzip "$TARBALL"
echo 'Uploading the test reports .. '
curl -F "file=@$TARBALL.gz" 'https://file.io/'
echo
echo 'Download the test reports from the URL above.'
- name: CI notification to Slack
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took
author_name: Backend CI
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}