-
Notifications
You must be signed in to change notification settings - Fork 753
161 lines (136 loc) · 5.18 KB
/
pull_request_full_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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
name: CI Full Build Ubuntu
on:
pull_request:
branches:
- master
- java21
jobs:
build-lang:
name: Build Ballerina Lang
runs-on: ubuntu-latest
timeout-minutes: 120
concurrency:
group: ${{ github.head_ref }}-FBP-lang
cancel-in-progress: true
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21.0.3'
- name: Checkout To Lang Branch
run: |
git checkout ${{ github.event.inputs.ballerina_lang_branch }}
- name: Get Lang Version
id: lang-version
run: |
VERSION=$((grep -w "version" | cut -d= -f2) < gradle.properties)
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Build ballerina-lang
run: |
./gradlew clean build -x check publishToMavenLocal --stacktrace --scan
- name: Archive Lang Artifacts
uses: actions/upload-artifact@v4
with:
name: Ballerina Lang Artifacts
path: ~/.m2/
include-hidden-files: true
outputs:
lang_version: ${{ steps.lang-version.outputs.version }}
build-stdlib-level:
needs: build-lang
name: Build Stdlib Level
runs-on: ubuntu-latest
timeout-minutes: 120
concurrency:
group: ${{ github.head_ref }}-FBP-stdlib-${{ matrix.level }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:
level: [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21.0.3'
- name: Setup NodeJs
uses: actions/setup-node@v4
with:
node-version: 10.22.1
- name: Download Ballerina Lang Artifacts
uses: actions/download-artifact@v4
with:
name: Ballerina Lang Artifacts
path: ~/.m2/
- name: Download Module Data
run: |
wget https://raw.githubusercontent.com/ballerina-platform/ballerina-release/master/dependabot/resources/extensions.json
wget https://raw.githubusercontent.com/ballerina-platform/ballerina-distribution/2201.0.x/gradle.properties
- name: Clone Modules
run: |
for module_name in $(jq -r '.standard_library| .[] | select(.level==${{ matrix.level }}) | .name' extensions.json); \
do git clone https://github.com/ballerina-platform/${module_name}.git; \
done
- name: Checkout non-default branch
run: |
for module_name in $(jq -r '.standard_library| .[] | select(.level==${{ matrix.level }}) | .name' extensions.json); do \
cd $module_name && git fetch origin && git checkout -t origin/java21 && cd ..; \
done
- name: Update Lang Version in Module
run: |
for module_name in $(jq -r '.standard_library| .[] | select(.level==${{ matrix.level }}) | .name' extensions.json); do \
perl -pi -e "s/^\s*ballerinaLangVersion=.*/ballerinaLangVersion=${{ needs.build-lang.outputs.lang_version }}/" ${module_name}/gradle.properties; \
done
- name: Build Module
run: |
for module_name in $(jq -r '.standard_library| .[] | select(.level==${{ matrix.level }}) | .name' extensions.json); do \
echo "Building Standard Library: $module_name" && \
cd $module_name && ./gradlew clean build --stacktrace --scan && cd ..; \
done
env:
packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }}
packagePAT: ${{ secrets.GITHUB_TOKEN }}
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }}
build-distribution:
needs: build-lang
name: Build Ballerina Distribution
runs-on: ubuntu-latest
timeout-minutes: 120
concurrency:
group: ${{ github.head_ref }}-FBP-distribution
cancel-in-progress: true
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
repository: 'ballerina-platform/ballerina-distribution'
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21.0.3'
- name: Checkout non-default branch
run: |
git fetch origin && git checkout -t origin/java21
- name: Download Ballerina Lang Artifacts
uses: actions/download-artifact@v4
with:
name: Ballerina Lang Artifacts
path: ~/.m2/
- name: Update Lang Version in Module
run: |
perl -pi -e "s/^\s*ballerinaLangVersion=.*/ballerinaLangVersion=${{ needs.build-lang.outputs.lang_version }}/" gradle.properties
- name: Build Module
run: ./gradlew clean build --stacktrace --scan --console=plain --no-daemon --continue -x :project-api-tests:test
env:
packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }}
packagePAT: ${{ secrets.GITHUB_TOKEN }}
devCentralToken: ${{ secrets.BALLERINA_DEV_CENTRAL_ACCESS_TOKEN }}