1
+ name : Build and use plugin
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - ' *'
7
+ jobs :
8
+ build :
9
+ runs-on : ${{ matrix.operating-system }}
10
+ environment :
11
+ name : ${{ github.ref_name }}
12
+ strategy :
13
+ matrix :
14
+ operating-system : [ubuntu-latest]
15
+ # Use both LTS releases and latest one for tests
16
+ versions : [ { jdk: 17, mapping-service: v1.0.5 }, { jdk: 23, mapping-service: latest } ]
17
+
18
+ steps :
19
+ - name : Checkout repository
20
+ uses : actions/checkout@v4
21
+
22
+ - name : Extract branch name
23
+ shell : bash
24
+ run : echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
25
+ id : extract_branch
26
+
27
+ - name : Set up JDK
28
+ uses : actions/setup-java@v4
29
+ with :
30
+ distribution : ' zulu'
31
+ java-version : ${{ matrix.versions.jdk }}
32
+
33
+ - name : Build with Gradle
34
+ run : |
35
+ JAR_VERSION=$(./mappingservice-plugin/gradlew printVersion -q -p ./mappingservice-plugin/)
36
+ JAR_VERSION=${JAR_VERSION##*$'\n'}
37
+ ./mappingservice-plugin/gradlew clean jar -p ./mappingservice-plugin/
38
+ ls -ll ./mappingservice-plugin/build/libs/
39
+ echo "JAR_VERSION=${JAR_VERSION}"
40
+ mv -v ./mappingservice-plugin/build/libs/SEMImagePlugin-$JAR_VERSION-plain.jar ./mappingservice-plugin/build/libs/SEMplugin.jar
41
+ env :
42
+ CI_BRANCH_NAME : ${{ steps.extract_branch.outputs.branch }}
43
+
44
+ - name : Upload job artifact
45
+ uses : actions/upload-artifact@v4
46
+ with :
47
+ name : jar-jdk${{ matrix.versions.jdk }}
48
+ path : ./mappingservice-plugin/build/libs/SEMplugin.jar
49
+
50
+ test :
51
+ runs-on : ${{ matrix.operating-system }}
52
+ environment :
53
+ name : ${{ github.ref_name }}
54
+ strategy :
55
+ fail-fast : false # We want to test independent of each other - success on a stable version is more important than on the latest version
56
+ matrix :
57
+ operating-system : [ubuntu-latest]
58
+ # Use both LTS releases and latest one for tests
59
+ versions : [ { jdk: 17, mapping-service: v1.0.5 }, { jdk: 23, mapping-service: latest } ]
60
+ needs : build
61
+ steps :
62
+ - name : Checkout repository
63
+ uses : actions/checkout@v4
64
+ - name : Extract branch name
65
+ shell : bash
66
+ run : echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
67
+ id : extract_branch
68
+ - name : Download built jar
69
+ uses : actions/download-artifact@v4
70
+ with :
71
+ name : jar-jdk${{ matrix.versions.jdk }}
72
+ path : ./plugins
73
+
74
+ - name : Run Docker Container # and wait for mapping service to be healthy before proceeding to tests
75
+ run : |
76
+ docker run -d -p 8095:8095 -e PIP_BREAK_SYSTEM_PACKAGES=1 -v ./plugins/SEMplugin.jar:/spring/mapping-service/plugins/SEMplugin.jar --name mapping4docker ghcr.io/kit-data-manager/mapping-service:${{ matrix.versions.mapping-service }}
77
+ echo "Wait for mapping service to be healthy before proceeding to tests"
78
+ while true; do
79
+ if ! docker ps | grep -q mapping4docker; then
80
+ echo "Docker container stopped unexpectedly. Aborting."
81
+ exit 1
82
+ fi
83
+ if curl -f http://localhost:8095/actuator/info; then
84
+ echo "Service is running."
85
+ break
86
+ fi
87
+ echo "Waiting for the service to be ready..."
88
+ docker logs --tail 20 mapping4docker
89
+ sleep 5
90
+ done
91
+ - name : Run Tests with Hurl
92
+ run : |
93
+ curl --location --remote-name https://github.com/Orange-OpenSource/hurl/releases/download/6.0.0/hurl_6.0.0_amd64.deb
94
+ sudo dpkg -i hurl_6.0.0_amd64.deb
95
+ sudo apt install -y dos2unix
96
+ unix2dos -n ./mappingservice-plugin/integrationtests/basic.hurl ./mappingservice-plugin/integrationtests/basic_crlf.hurl
97
+ hurl --variable host=http://localhost:8095 --test ./mappingservice-plugin/integrationtests/basic_crlf.hurl --verbose --file-root .
98
+ env :
99
+ CI_BRANCH_NAME : ${{ steps.extract_branch.outputs.branch }}
100
+ - name : Stop Docker Container
101
+ run : docker stop mapping4docker
0 commit comments