From 140a67501d737f82773d042554d490e9bc542e9c Mon Sep 17 00:00:00 2001 From: Daniel Widdis Date: Sat, 14 Oct 2023 10:07:18 -0700 Subject: [PATCH 1/2] Run integ tests in parallel with build Signed-off-by: Daniel Widdis --- .github/workflows/CI.yml | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 97a1f4827..d7ff95e01 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -1,4 +1,4 @@ -name: Build and Test Plugin +name: CI on: push: @@ -9,14 +9,12 @@ on: jobs: spotless: - if: github.repository == 'opensearch-project/opensearch-ai-flow-framework' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Spotless Check run: ./gradlew spotlessCheck javadoc: - if: github.repository == 'opensearch-project/opensearch-ai-flow-framework' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -25,19 +23,14 @@ jobs: - name: Javadoc Check run: ./gradlew javadoc build: + if: github.repository == 'opensearch-project/opensearch-ai-flow-framework' needs: [spotless, javadoc] strategy: matrix: - os: - - ubuntu-latest - - macOS-latest - - windows-latest - java: - - 17 - name: Build and Test Plugin Template - if: github.repository == 'opensearch-project/opensearch-ai-flow-framework' + os: [ubuntu-latest, macos-latest, windows-latest] + java: [11, 17, 20] + name: Test JDK${{ matrix.java }}, ${{ matrix.os }} runs-on: ${{ matrix.os }} - steps: - uses: actions/checkout@v4 - name: Set up JDK ${{ matrix.java }} @@ -47,9 +40,28 @@ jobs: distribution: temurin - name: Build and Run Tests run: | - ./gradlew check + ./gradlew check -x integTest -x yamlRestTest - name: Upload Coverage Report - if: matrix.os == 'ubuntu-latest' + if: matrix.os == 'ubuntu-latest' && ${{ matrix.java }} == 17 uses: codecov/codecov-action@v3 with: file: ./build/reports/jacoco/test/jacocoTestReport.xml + integTest: + if: github.repository == 'opensearch-project/opensearch-ai-flow-framework' + needs: [spotless, javadoc] + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + java: [11, 17, 20] + name: Integ Test JDK${{ matrix.java }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - name: Set up JDK ${{ matrix.java }} + uses: actions/setup-java@v3 + with: + java-version: ${{ matrix.java }} + distribution: temurin + - name: Build and Run Tests + run: | + ./gradlew integTest yamlRestTest From 3e4211ae6bd1089f78326cb9c24c77a43966541e Mon Sep 17 00:00:00 2001 From: Daniel Widdis Date: Mon, 16 Oct 2023 10:42:06 -0700 Subject: [PATCH 2/2] Repo check on all runs, reduce JDK17 runs to ubuntu only Signed-off-by: Daniel Widdis --- .github/workflows/CI.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d7ff95e01..ff6668af3 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -9,12 +9,14 @@ on: jobs: spotless: + if: github.repository == 'opensearch-project/opensearch-ai-flow-framework' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Spotless Check run: ./gradlew spotlessCheck javadoc: + if: github.repository == 'opensearch-project/opensearch-ai-flow-framework' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -23,12 +25,15 @@ jobs: - name: Javadoc Check run: ./gradlew javadoc build: - if: github.repository == 'opensearch-project/opensearch-ai-flow-framework' needs: [spotless, javadoc] strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - java: [11, 17, 20] + java: [11, 20] + include: + - os: ubuntu-latest + java: 17 + codecov: yes name: Test JDK${{ matrix.java }}, ${{ matrix.os }} runs-on: ${{ matrix.os }} steps: @@ -42,17 +47,19 @@ jobs: run: | ./gradlew check -x integTest -x yamlRestTest - name: Upload Coverage Report - if: matrix.os == 'ubuntu-latest' && ${{ matrix.java }} == 17 + if: ${{ matrix.codecov }} uses: codecov/codecov-action@v3 with: file: ./build/reports/jacoco/test/jacocoTestReport.xml integTest: - if: github.repository == 'opensearch-project/opensearch-ai-flow-framework' needs: [spotless, javadoc] strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - java: [11, 17, 20] + java: [11, 20] + include: + - os: ubuntu-latest + java: 17 name: Integ Test JDK${{ matrix.java }}, ${{ matrix.os }} runs-on: ${{ matrix.os }} steps: