From 2b407545727dad54d37856699997d9867a87202a Mon Sep 17 00:00:00 2001 From: Ankit Kala Date: Mon, 23 Aug 2021 12:45:19 +0530 Subject: [PATCH] Add basic github workflow for build and test Signed-off-by: Sooraj Sinha --- .github/workflows/build.yml | 65 +++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..7e86c8cb3 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,65 @@ +name: Test and Build Workflow +# This workflow is triggered on pull requests to main branch +on: + pull_request: + branches: + - '*' + push: + branches: + - '*' + +jobs: + build: + # Job name + name: Build Replication plugin + runs-on: ubuntu-latest + steps: + # This step uses the setup-java Github action: https://github.com/actions/setup-java + - name: Set Up JDK 14 + uses: actions/setup-java@v1 + with: + java-version: 14 + # dependencies: OpenSearch + - name: Checkout OpenSearch + uses: actions/checkout@v2 + with: + repository: 'opensearch-project/OpenSearch' + path: OpenSearch + ref: 'main' + - name: Build OpenSearch + working-directory: ./OpenSearch + run: | + ./gradlew publishToMavenLocal -Dbuild.snapshot=true + # dependencies: common-utils + - name: Checkout common-utils + uses: actions/checkout@v2 + with: + ref: 'main' + repository: 'opensearch-project/common-utils' + path: common-utils + - name: Build common-utils + working-directory: ./common-utils + run: ./gradlew publishToMavenLocal -Dbuild.snapshot=true -Dopensearch.version=1.1.0-SNAPSHOT + # This step uses the checkout Github action: https://github.com/actions/checkout + - name: Checkout Branch + uses: actions/checkout@v2 + - name: Build and run Replication tests + run: | + ./gradlew clean release -Dbuild.snapshot=true -Dopensearch.version=1.1.0-SNAPSHOT + - name: Upload failed logs + uses: actions/upload-artifact@v2 + if: failure() + with: + name: logs + path: | + build/testclusters/integTest-*/logs/* + build/testclusters/leaderCluster-*/logs/* + build/testclusters/followCluster-*/logs/* + - name: Create Artifact Path + run: | + pwd + mkdir -p cross-cluster-replication-artifacts + cp ./build/distributions/*.zip cross-cluster-replication-artifacts + pwd + - name: Uploads coverage + uses: codecov/codecov-action@v1.2.1