-
Notifications
You must be signed in to change notification settings - Fork 58
75 lines (66 loc) · 2.09 KB
/
s4hana-build-with-bal-test-graalvm.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
name: Build with bal test graalvm (S/4 HANA Connector)
on:
workflow_call:
inputs:
hana-connector-group:
required: true
type: string
jobs:
generate-matrix:
name: Generate Matrix
runs-on: ubuntu-latest
outputs:
directories: ${{ steps.set-matrix.outputs.directories }}
steps:
- name: Checkout the Repository
uses: actions/checkout@v3
- name: Set matrix for build
id: set-matrix
run: |
folders=()
cd ballerina
for dir in $(find . -type d -maxdepth 1 -mindepth 1 | cut -c3-); do
if [[ "$dir" == resources ]]; then
continue
fi
folders+=("$dir");
done
echo "directories=$(jq -nc --args '$ARGS.positional' ${folders[@]})" >> $GITHUB_OUTPUT
build:
runs-on: ubuntu-latest
needs: generate-matrix
strategy:
matrix:
directory: ${{ fromJSON(needs.generate-matrix.outputs.directories) }}
steps:
- name: Checkout the Repository
uses: actions/checkout@v3
- name: Set Up Ballerina
uses: ballerina-platform/setup-ballerina@v1.1.0
with:
version: latest
- name: Set up GraalVM
uses: graalvm/setup-graalvm@v1
with:
java-version: "17"
distribution: "graalvm-community"
set-java-home: true
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Check GraalVM installation
run: |
echo "GRAALVM_HOME: ${{ env.GRAALVM_HOME }}"
echo "JAVA_HOME: ${{ env.JAVA_HOME }}"
native-image --version
- name: Build Package
run: ./gradlew :${{ inputs.hana-connector-group }}-ballerina:${{ matrix.directory }}:build
env:
packageUser: ${{ github.actor }}
packagePAT: ${{ secrets.GITHUB_TOKEN }}
- name: Remove Target Directory
run: |
cd ballerina/${{ matrix.directory }}
sudo rm -rf target
- name: Test with GraalVM
run: |
cd ballerina/${{ matrix.directory }}
IS_BAL_BUILD=true bal test --graalvm