|
2 | 2 | name: manifests
|
3 | 3 |
|
4 | 4 | on:
|
5 |
| - push: |
6 | 5 | pull_request:
|
7 |
| - paths: |
8 |
| - - 'manifests/**/*.yml' |
9 |
| - - '!manifests/templates/**/' |
10 |
| - schedule: |
11 |
| - - cron: 0 0 * * * |
| 6 | + paths: |
| 7 | + - 'manifests/**/*.yml' |
| 8 | + - '!manifests/templates/**/' |
| 9 | + - 'legacy-manifests/**/*.yml' |
12 | 10 |
|
13 | 11 | jobs:
|
14 |
| - list-manifests11: |
| 12 | + list-changed-manifests: |
15 | 13 | runs-on: ubuntu-latest
|
16 | 14 | outputs:
|
17 | 15 | matrix: ${{ steps.set-matrix.outputs.matrix }}
|
18 | 16 | steps:
|
19 |
| - - uses: actions/checkout@v3 |
20 |
| - - id: set-matrix |
21 |
| - run: echo "::set-output name=matrix::$(ls manifests/**/opensearch*.yml | awk -F/ '{if($2<2)print$0}' | jq -R -s -c 'split("\n")[:-1]')" |
22 |
| - |
23 |
| - list-manifests17: |
24 |
| - runs-on: ubuntu-latest |
25 |
| - outputs: |
26 |
| - matrix: ${{ steps.set-matrix.outputs.matrix }} |
27 |
| - steps: |
28 |
| - - uses: actions/checkout@v3 |
29 |
| - - id: set-matrix |
30 |
| - run: echo "::set-output name=matrix::$(ls manifests/**/opensearch*.yml | awk -F/ '{if($2>2)print$0}' | jq -R -s -c 'split("\n")[:-1]')" |
| 17 | + - name: Checkout |
| 18 | + uses: actions/checkout@v3 |
| 19 | + - name: Get changed manifest files |
| 20 | + uses: tj-actions/changed-files@v41 |
| 21 | + id: list-changed-manifests |
| 22 | + with: |
| 23 | + files: manifests/**/opensearch*.yml |
| 24 | + json: true |
| 25 | + quotepath: false |
| 26 | + dir_names: false |
31 | 27 |
|
| 28 | + - name: Set unique changed manifests as matrix |
| 29 | + id: set-matrix |
| 30 | + run: echo "matrix={\"manifest\":${{ steps.list-changed-manifests.outputs.all_changed_files }}}" >> "$GITHUB_OUTPUT" |
32 | 31 |
|
33 |
| - manifest-checks-jdk11: |
34 |
| - needs: list-manifests11 |
| 32 | + manifest-checks: |
| 33 | + needs: [list-changed-manifests] |
35 | 34 | runs-on: ubuntu-latest
|
36 | 35 | env:
|
37 | 36 | PYTHON_VERSION: 3.9
|
38 |
| - JDK_VERSION: 11 |
39 | 37 | strategy:
|
40 |
| - matrix: |
41 |
| - manifest: ${{ fromJson(needs.list-manifests11.outputs.matrix) }} |
| 38 | + fail-fast: false |
| 39 | + matrix: ${{ fromJson(needs.list-changed-manifests.outputs.matrix) }} |
42 | 40 | steps:
|
43 | 41 | - uses: actions/checkout@v3
|
44 |
| - - name: Set Up JDK ${{ env.JDK_VERSION }} |
45 |
| - uses: actions/setup-java@v1 |
46 |
| - with: |
47 |
| - java-version: ${{ env.JDK_VERSION }} |
48 |
| - - name: Set up Python ${{ env.PYTHON_VERSION }} |
49 |
| - uses: actions/setup-python@v3 |
50 |
| - with: |
51 |
| - python-version: ${{ env.PYTHON_VERSION }} |
52 |
| - - name: Install Pipenv and Dependencies |
| 42 | + - name: Check JDK Version |
53 | 43 | run: |
|
54 |
| - python -m pip install --upgrade pipenv wheel |
55 |
| - - name: OpenSearch Manifests |
56 |
| - run: |- |
57 |
| - ./ci.sh ${{ matrix.manifest }} --snapshot |
58 |
| -
|
59 |
| - manifest-checks-jdk17: |
60 |
| - needs: list-manifests17 |
61 |
| - runs-on: ubuntu-latest |
62 |
| - env: |
63 |
| - PYTHON_VERSION: 3.9 |
64 |
| - JDK_VERSION: 17 |
65 |
| - strategy: |
66 |
| - matrix: |
67 |
| - manifest: ${{ fromJson(needs.list-manifests17.outputs.matrix) }} |
68 |
| - steps: |
69 |
| - - uses: actions/checkout@v3 |
70 |
| - - name: Set Up JDK ${{ env.JDK_VERSION }} |
| 44 | + java_version=`cat ${{ matrix.manifest }} | yq -r .ci.image.args | grep -Eo '[0-9]+' || echo ''` |
| 45 | + echo $java_version |
| 46 | + echo "JAVA_VERSION=$java_version" >> "$GITHUB_ENV" |
| 47 | + - name: Set Up JDK ${{ env.JAVA_VERSION }} |
| 48 | + if: ${{ env.JAVA_VERSION }} |
71 | 49 | uses: actions/setup-java@v1
|
72 | 50 | with:
|
73 |
| - java-version: ${{ env.JDK_VERSION }} |
| 51 | + java-version: ${{ env.JAVA_VERSION }} |
74 | 52 | - name: Set up Python ${{ env.PYTHON_VERSION }}
|
75 | 53 | uses: actions/setup-python@v3
|
76 | 54 | with:
|
|
0 commit comments