-
Notifications
You must be signed in to change notification settings - Fork 49
95 lines (82 loc) · 2.94 KB
/
daily-build.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
name: Daily build
on:
schedule:
- cron: '30 2 * * *'
jobs:
build:
runs-on: ubuntu-latest
services:
mongodb:
image: mongo:4.2.0
env:
# Following credentials are only used during testing in docker container
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: admin
ports:
- 27011:27017
mongodb-ssl:
image: rzhilkibaev/mongo-x509-auth-ssl:latest
ports:
- 27012:27017
steps:
- uses: actions/checkout@v3
# Set up Java Environment
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17.0.7
# Setup Ballerina Environment
- name: Set Up Ballerina
uses: ballerina-platform/[email protected]
with:
version: latest
# Grant execute permission to the gradlew script
- name: Grant execute permission for gradlew
run: chmod +x gradlew
# Build the project with Gradle
- name: Build with Gradle
env:
packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }}
packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }}
JAVA_OPTS: -DBALLERINA_DEV_COMPILE_BALLERINA_ORG=true
run: |
./gradlew build -x test
# Build Ballerina Project
- name: Ballerina Build
run: bal pack ./ballerina
env:
JAVA_HOME: /usr/lib/jvm/default-jvm
# Test Ballerina MongoDB-SSL
- name: SSL Tests
run: bal test --groups mongodb-ssl --test-report --code-coverage --coverage-format=xml ./ballerina
env:
JAVA_HOME: /usr/lib/jvm/default-jvm
# Following credentials are only used during testing in docker container
MONGODB_USER: C=US,ST=CA,L=San Francisco,O=Jaspersoft,OU=JSDev,CN=admin
- name: Upload SSL test coverage reports to Codecov
uses: codecov/codecov-action@v3
# Test Ballerina MongoDB
- name: MongoDB Test
run: bal test --groups mongodb --test-report --code-coverage --coverage-format=xml ./ballerina
env:
JAVA_HOME: /usr/lib/jvm/default-jvm
# Following credentials are only used during testing in docker container
MONGODB_USER: admin
MONGODB_PASSWORD: admin
- name: Upload MongoDB test coverage reports to Codecov
uses: codecov/codecov-action@v3
# 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\": \"module-ballerinax-mongodb\"
}
}"