forked from ballerina-platform/ballerina-library
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (63 loc) · 1.98 KB
/
daily-build-connector-template.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
name: Daily Build (Connector)
on:
workflow_call:
inputs:
repo-name:
required: true
type: string
additional-build-flags:
required: false
type: string
default: ""
additional-test-flags:
required: false
type: string
default: ""
jobs:
ubuntu-build:
name: Build
runs-on: ubuntu-latest
concurrency:
group: ${{ github.head_ref }}-ubuntu-build
cancel-in-progress: true
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set Up Ballerina
uses: ballerina-platform/setup-ballerina@v1.1.0
with:
version: latest
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: 17.0.7
- name: Set ENV Variables
run: |
echo -e '${{ toJson(secrets) }}' | jq -r 'to_entries[] | .key + "=" + .value' >> $GITHUB_ENV
- name: Build the Package
env:
packageUser: ${{ github.actor }}
packagePAT: ${{ secrets.GITHUB_TOKEN }}
run: |
./gradlew build -x test ${{ inputs.additional-build-flags }} -PbuildUsingDocker=nightly
- name: Test the Package
env:
packageUser: ${{ github.actor }}
packagePAT: ${{ secrets.GITHUB_TOKEN }}
run: |
./gradlew test ${{ inputs.additional-test-flags }} -PbuildUsingDocker=nightly
# Send notification when build fails
- name: Notify failure
if: ${{ failure() }}
run: |
curl -X POST \
'https://api.github.com/repos/ballerina-platform/ballerina-release/dispatches' \
-H 'Accept: application/vnd.github.v3+json' \
-H 'Authorization: Bearer ${{ secrets.BALLERINA_BOT_TOKEN }}' \
--data "{
\"event_type\": \"notify-build-failure\",
\"client_payload\": {
\"repoName\": \"${{ inputs.repo-name }}\"
}
}"