Skip to content

Commit

Permalink
Onboard jenkins prod docker images on github actions (opensearch-proj…
Browse files Browse the repository at this point in the history
…ect#1763)

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
  • Loading branch information
peterzhuamazon authored Nov 2, 2023
1 parent fe38a6c commit 8b5576a
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 27 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/dco.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,25 @@ name: Test and Build OpenSearch Observability Backend Plugin
on: [pull_request, push]

jobs:
build:
Get-CI-Image-Tag:
uses: opensearch-project/opensearch-build/.github/workflows/get-ci-image-tag.yml@main
with:
product: opensearch

build-linux:
needs: Get-CI-Image-Tag
strategy:
# Run all jobs
fail-fast: false
matrix:
java: [11, 17]
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
container:
# using the same image which is used by opensearch-build team to build the OpenSearch Distribution
# this image tag is subject to change as more dependencies and updates will arrive over time
image: ${{ needs.Get-CI-Image-Tag.outputs.ci-image-version-linux }}
# need to switch to root so that github actions can install runner binary on container without permission issues.
options: --user root

steps:
- uses: actions/checkout@v1
Expand All @@ -21,18 +32,17 @@ jobs:
java-version: ${{ matrix.java }}

- name: Run Backwards Compatibility Tests
# Temporarily only do this for linux
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
echo "Running backwards compatibility tests ..."
./gradlew bwcTestSuite -Dtests.security.manager=false
chown -R 1000:1000 `pwd`
su `id -un 1000` -c "./gradlew bwcTestSuite -Dtests.security.manager=false"
- name: Build with Gradle
run: |
./gradlew build
chown -R 1000:1000 `pwd`
su `id -un 1000` -c "./gradlew build"
- name: Upload coverage
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: codecov/codecov-action@v1
with:
flags: opensearch-observability
Expand All @@ -44,8 +54,40 @@ jobs:
mkdir -p opensearch-observability-builds
cp -r ./build/distributions/*.zip opensearch-observability-builds/
- name: Upload Artifacts
uses: actions/upload-artifact@v1
with:
name: opensearch-observability-ubuntu-latest
path: opensearch-observability-builds

build-windows-macos:
strategy:
# Run all jobs
fail-fast: false
matrix:
java: [11, 17]
os: [windows-latest, macos-latest]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v1

- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}

- name: Build with Gradle
run: |
./gradlew build
- name: Create Artifact Path
run: |
mkdir -p opensearch-observability-builds
cp -r ./build/distributions/*.zip opensearch-observability-builds/
- name: Upload Artifacts
uses: actions/upload-artifact@v1
with:
name: opensearch-observability-${{ matrix.os }}
path: opensearch-observability-builds
path: opensearch-observability-builds

0 comments on commit 8b5576a

Please sign in to comment.