-
Notifications
You must be signed in to change notification settings - Fork 274
63 lines (59 loc) · 2.03 KB
/
manifests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
name: manifests-ci-check
on:
pull_request:
types: [labeled, synchronize]
paths:
- 'manifests/**/*.yml'
- '!manifests/templates/**/'
- 'legacy-manifests/**/*.yml'
jobs:
list-changed-manifests:
if: ${{ github.repository == 'opensearch-project/opensearch-build' && github.event.label.name == 'manifest-ci-check' }}
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get changed manifest files
uses: tj-actions/changed-files@e9772d140489982e0e3704fea5ee93d536f1e275
id: list-changed-manifests
with:
files: manifests/**/opensearch*.yml
json: true
quotepath: false
dir_names: false
- name: Set unique changed manifests as matrix
id: set-matrix
run: echo "matrix={\"manifest\":${{ steps.list-changed-manifests.outputs.all_changed_files }}}" >> "$GITHUB_OUTPUT"
manifest-checks:
needs: [list-changed-manifests]
runs-on: ubuntu-latest
env:
PYTHON_VERSION: 3.9
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.list-changed-manifests.outputs.matrix) }}
steps:
- uses: actions/checkout@v3
- name: Check JDK Version
run: |
java_version=`cat ${{ matrix.manifest }} | yq -r .ci.image.args | grep -Eo '[0-9]+' || echo ''`
echo $java_version
echo "JAVA_VERSION=$java_version" >> "$GITHUB_ENV"
- name: Set Up JDK ${{ env.JAVA_VERSION }}
if: ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v1
with:
java-version: ${{ env.JAVA_VERSION }}
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v3
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