From 2b3ef3b7a04648777935235700b70f7e07530812 Mon Sep 17 00:00:00 2001 From: Zelin Hao Date: Wed, 6 Jul 2022 17:25:38 -0700 Subject: [PATCH] Add conditional checks for jdk14 and jdk17 Signed-off-by: Zelin Hao --- .github/workflows/manifests.yml | 47 ++++++++++++++++++++++---- .github/workflows/manifests_JDK17.yml | 48 +++++++++++++++++++++++++++ 2 files changed, 88 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/manifests_JDK17.yml diff --git a/.github/workflows/manifests.yml b/.github/workflows/manifests.yml index 5bcf07401f..c61b40adfd 100644 --- a/.github/workflows/manifests.yml +++ b/.github/workflows/manifests.yml @@ -5,31 +5,64 @@ on: push: pull_request: paths: - - 'manifests/**/*.yml' - - '!manifests/3.**/**' + - manifests/**/*.yml schedule: - cron: 0 0 * * * jobs: + list-manifests14: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - uses: actions/checkout@v2 + - id: set-matrix + run: echo "::set-output name=matrix::$(ls manifests/**/opensearch*.yml | awk -F/ '{if($2<3)print$0}' | jq -R -s -c 'split("\n")[:-1]')" - list-manifests: + list-manifests17: runs-on: ubuntu-latest outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} steps: - uses: actions/checkout@v2 - id: set-matrix - run: echo "::set-output name=matrix::$(ls manifests/**/opensearch*.yml | jq -R -s -c 'split("\n")[:-1]')" + run: echo "::set-output name=matrix::$(ls manifests/**/opensearch*.yml | awk -F/ '{if($2>3)print$0}' | jq -R -s -c 'split("\n")[:-1]')" - check: - needs: list-manifests + manifest-checks-jdk14: + needs: list-manifests14 runs-on: ubuntu-latest env: PYTHON_VERSION: 3.7 JDK_VERSION: 14 strategy: matrix: - manifest: ${{ fromJson(needs.list-manifests.outputs.matrix) }} + manifest: ${{ fromJson(needs.list-manifests14.outputs.matrix) }} + steps: + - uses: actions/checkout@v2 + - name: Set Up JDK ${{ env.JDK_VERSION }} + uses: actions/setup-java@v1 + with: + java-version: ${{ env.JDK_VERSION }} + - name: Set up Python ${{ env.PYTHON_VERSION }} + uses: actions/setup-python@v2 + with: + python-version: ${{ env.PYTHON_VERSION }} + - name: Install Pipenv and Dependencies + run: | + python -m pip install --upgrade pipenv wheel + - name: OpenSearch Manifests + run: |- + ./ci.sh ${{ matrix.manifest }} --snapshot + + manifest-checks-jdk17: + needs: list-manifests17 + runs-on: ubuntu-latest + env: + PYTHON_VERSION: 3.7 + JDK_VERSION: 17 + strategy: + matrix: + manifest: ${{ fromJson(needs.list-manifests17.outputs.matrix) }} steps: - uses: actions/checkout@v2 - name: Set Up JDK ${{ env.JDK_VERSION }} diff --git a/.github/workflows/manifests_JDK17.yml b/.github/workflows/manifests_JDK17.yml new file mode 100644 index 0000000000..5bcf07401f --- /dev/null +++ b/.github/workflows/manifests_JDK17.yml @@ -0,0 +1,48 @@ +--- +name: manifests + +on: + push: + pull_request: + paths: + - 'manifests/**/*.yml' + - '!manifests/3.**/**' + schedule: + - cron: 0 0 * * * + +jobs: + + list-manifests: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - uses: actions/checkout@v2 + - id: set-matrix + run: echo "::set-output name=matrix::$(ls manifests/**/opensearch*.yml | jq -R -s -c 'split("\n")[:-1]')" + + check: + needs: list-manifests + runs-on: ubuntu-latest + env: + PYTHON_VERSION: 3.7 + JDK_VERSION: 14 + strategy: + matrix: + manifest: ${{ fromJson(needs.list-manifests.outputs.matrix) }} + steps: + - uses: actions/checkout@v2 + - name: Set Up JDK ${{ env.JDK_VERSION }} + uses: actions/setup-java@v1 + with: + java-version: ${{ env.JDK_VERSION }} + - name: Set up Python ${{ env.PYTHON_VERSION }} + uses: actions/setup-python@v2 + with: + python-version: ${{ env.PYTHON_VERSION }} + - name: Install Pipenv and Dependencies + run: | + python -m pip install --upgrade pipenv wheel + - name: OpenSearch Manifests + run: |- + ./ci.sh ${{ matrix.manifest }} --snapshot