@@ -3,14 +3,25 @@ name: Test and Build OpenSearch Observability Backend Plugin
33on : [pull_request, push]
44
55jobs :
6- build :
6+ Get-CI-Image-Tag :
7+ uses : opensearch-project/opensearch-build/.github/workflows/get-ci-image-tag.yml@main
8+ with :
9+ product : opensearch
10+
11+ build-linux :
12+ needs : Get-CI-Image-Tag
713 strategy :
814 # Run all jobs
915 fail-fast : false
1016 matrix :
1117 java : [11, 17]
12- os : [ubuntu-latest, windows-latest, macos-latest]
13- runs-on : ${{ matrix.os }}
18+ runs-on : ubuntu-latest
19+ container :
20+ # using the same image which is used by opensearch-build team to build the OpenSearch Distribution
21+ # this image tag is subject to change as more dependencies and updates will arrive over time
22+ image : ${{ needs.Get-CI-Image-Tag.outputs.ci-image-version-linux }}
23+ # need to switch to root so that github actions can install runner binary on container without permission issues.
24+ options : --user root
1425
1526 steps :
1627 - uses : actions/checkout@v1
@@ -21,18 +32,17 @@ jobs:
2132 java-version : ${{ matrix.java }}
2233
2334 - name : Run Backwards Compatibility Tests
24- # Temporarily only do this for linux
25- if : ${{ matrix.os == 'ubuntu-latest' }}
2635 run : |
2736 echo "Running backwards compatibility tests ..."
28- ./gradlew bwcTestSuite -Dtests.security.manager=false
37+ chown -R 1000:1000 `pwd`
38+ su `id -un 1000` -c "./gradlew bwcTestSuite -Dtests.security.manager=false"
2939
3040 - name : Build with Gradle
3141 run : |
32- ./gradlew build
42+ chown -R 1000:1000 `pwd`
43+ su `id -un 1000` -c "./gradlew build"
3344
3445 - name : Upload coverage
35- if : ${{ matrix.os == 'ubuntu-latest' }}
3646 uses : codecov/codecov-action@v1
3747 with :
3848 flags : opensearch-observability
4454 mkdir -p opensearch-observability-builds
4555 cp -r ./build/distributions/*.zip opensearch-observability-builds/
4656
57+ - name : Upload Artifacts
58+ uses : actions/upload-artifact@v1
59+ with :
60+ name : opensearch-observability-ubuntu-latest
61+ path : opensearch-observability-builds
62+
63+ build-windows-macos :
64+ strategy :
65+ # Run all jobs
66+ fail-fast : false
67+ matrix :
68+ java : [11, 17]
69+ os : [windows-latest, macos-latest]
70+ runs-on : ${{ matrix.os }}
71+
72+ steps :
73+ - uses : actions/checkout@v1
74+
75+ - name : Set up JDK ${{ matrix.java }}
76+ uses : actions/setup-java@v1
77+ with :
78+ java-version : ${{ matrix.java }}
79+
80+ - name : Build with Gradle
81+ run : |
82+ ./gradlew build
83+
84+ - name : Create Artifact Path
85+ run : |
86+ mkdir -p opensearch-observability-builds
87+ cp -r ./build/distributions/*.zip opensearch-observability-builds/
88+
4789 - name : Upload Artifacts
4890 uses : actions/upload-artifact@v1
4991 with :
5092 name : opensearch-observability-${{ matrix.os }}
51- path : opensearch-observability-builds
93+ path : opensearch-observability-builds
0 commit comments