From 47d5e4d37495d44ced4aa1d0fa33468015de6098 Mon Sep 17 00:00:00 2001 From: Ankit Kala Date: Mon, 17 Oct 2022 20:59:58 +0530 Subject: [PATCH] Add windows & mac build Signed-off-by: Ankit Kala --- .github/workflows/build-and-test.yml | 51 ++++++++++++++++++++++++++++ .github/workflows/build.yml | 32 ++++++----------- 2 files changed, 61 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/build-and-test.yml diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml new file mode 100644 index 00000000..e8a6ace5 --- /dev/null +++ b/.github/workflows/build-and-test.yml @@ -0,0 +1,51 @@ +name: CCR Test Workflow +# This workflow is triggered on pull requests to main branch +on: + pull_request: + branches: + - '*' + push: + branches: + - '*' + +# We build for all combinations but run tests only on one combination (linux & latest java) +jobs: + build: + continue-on-error: true + strategy: + matrix: + java: + - 11 + - 17 + # Job name + name: Run integration tests on linux with Java ${{ matrix.java }} + runs-on: ubuntu-latest + steps: + # This step uses the setup-java Github action: https://github.com/actions/setup-java + - name: Set Up JDK ${{ matrix.java }} + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + # 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 -D"build.snapshot=true" + - 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: | + mkdir -p cross-cluster-replication-artifacts + cp ./build/distributions/*.zip cross-cluster-replication-artifacts + - name: Uploads coverage + with: + fetch-depth: 2 + uses: codecov/codecov-action@v1.2.1 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c3f599a0..1faf6511 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Test and Build Workflow +name: Build Replication plugin # This workflow is triggered on pull requests to main branch on: pull_request: @@ -8,16 +8,21 @@ on: branches: - '*' +# We build for other platforms except linux which is already covered in build-and-test. +# Also, We're not running tests here as those are already covered with linux build. jobs: build: + continue-on-error: true strategy: matrix: java: - - 11 - 17 + os: + - windows-latest + - macos-latest # Job name - name: Build Replication plugin - runs-on: ubuntu-latest + name: Java ${{ matrix.java }} On ${{ matrix.os }} + runs-on: ${{ matrix.os }} steps: # This step uses the setup-java Github action: https://github.com/actions/setup-java - name: Set Up JDK ${{ matrix.java }} @@ -29,21 +34,4 @@ jobs: uses: actions/checkout@v2 - name: Build and run Replication tests run: | - ./gradlew clean release -Dbuild.snapshot=true - - 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: | - mkdir -p cross-cluster-replication-artifacts - cp ./build/distributions/*.zip cross-cluster-replication-artifacts - - name: Uploads coverage - with: - fetch-depth: 2 - uses: codecov/codecov-action@v1.2.1 + ./gradlew clean release -D"build.snapshot=true" -x test -x IntegTest \ No newline at end of file