|
16 | 16 | # limitations under the License.
|
17 | 17 | ################################################################################
|
18 | 18 |
|
19 |
| - |
20 | 19 | # We need to specify repo related information here since Apache INFRA doesn't differentiate
|
21 | 20 | # between several workflows with the same names while preparing a report for GHA usage
|
22 | 21 | # https://infra-reports.apache.org/#ghactions
|
23 | 22 | name: Flink Kubernetes Operator CI
|
| 23 | + |
24 | 24 | on:
|
25 | 25 | push:
|
26 | 26 | branches:
|
27 | 27 | - main
|
28 | 28 | - release-*
|
29 | 29 | pull_request:
|
| 30 | + |
30 | 31 | concurrency:
|
31 | 32 | group: ${{ github.workflow }}-${{ github.ref_name }}
|
32 | 33 | cancel-in-progress: true
|
33 | 34 |
|
| 35 | +env: |
| 36 | + HELM_CHART_DIR: helm |
| 37 | + FLINK_OPERATOR_CHART: flink-kubernetes-operator |
| 38 | + |
34 | 39 | jobs:
|
| 40 | + helm_lint_test: |
| 41 | + runs-on: ubuntu-latest |
| 42 | + |
| 43 | + name: Helm Lint Test |
| 44 | + |
| 45 | + steps: |
| 46 | + - name: Determine branch name |
| 47 | + id: get_branch |
| 48 | + run: | |
| 49 | + BRANCH="" |
| 50 | + if [ "${{ github.event_name }}" == "push" ]; then |
| 51 | + BRANCH=${{ github.ref_name }} |
| 52 | + elif [ "${{ github.event_name }}" == "pull_request" ]; then |
| 53 | + BRANCH=${{ github.base_ref }} |
| 54 | + fi |
| 55 | + echo "BRANCH=$BRANCH" >> "$GITHUB_OUTPUT" |
| 56 | +
|
| 57 | + - name: Checkout source code |
| 58 | + uses: actions/checkout@v4 |
| 59 | + with: |
| 60 | + fetch-depth: 0 |
| 61 | + |
| 62 | + - name: Set up Helm |
| 63 | + |
| 64 | + with: |
| 65 | + version: v3.17.3 |
| 66 | + |
| 67 | + - name: Install Helm unittest plugin |
| 68 | + run: helm plugin install https://github.com/helm-unittest/helm-unittest.git --version 0.8.1 |
| 69 | + |
| 70 | + - name: Run Helm unittest |
| 71 | + run: helm unittest ${{ env.HELM_CHART_DIR }}/${{ env.FLINK_OPERATOR_CHART }} --file "tests/**/*_test.yaml" --strict --debug |
| 72 | + |
| 73 | + - name: Set up chart-testing |
| 74 | + |
| 75 | + |
| 76 | + - name: Run chart-testing (list-changed) |
| 77 | + id: list-changed |
| 78 | + env: |
| 79 | + BRANCH: ${{ steps.get_branch.outputs.BRANCH }} |
| 80 | + run: | |
| 81 | + changed=$(ct list-changed --target-branch $BRANCH --chart-dirs ${{ env.HELM_CHART_DIR }}) |
| 82 | + if [[ -n "$changed" ]]; then |
| 83 | + echo "changed=true" >> "$GITHUB_OUTPUT" |
| 84 | + fi |
| 85 | +
|
| 86 | + - name: Run Helm lint |
| 87 | + if: steps.list-changed.outputs.changed == 'true' |
| 88 | + run: | |
| 89 | + helm lint ${{ env.HELM_CHART_DIR }}/${{ env.FLINK_OPERATOR_CHART }} --strict --debug |
| 90 | +
|
| 91 | + - name: Run chart-testing (lint) |
| 92 | + if: steps.list-changed.outputs.changed == 'true' |
| 93 | + env: |
| 94 | + BRANCH: ${{ steps.get_branch.outputs.BRANCH }} |
| 95 | + run: ct lint --target-branch $BRANCH --chart-dirs ${{ env.HELM_CHART_DIR }} --check-version-increment=false --validate-maintainers=false |
| 96 | + |
35 | 97 | test_ci:
|
36 | 98 | runs-on: ubuntu-latest
|
37 | 99 | name: maven build
|
|
53 | 115 | echo "Please generate the java doc via 'mvn clean install -DskipTests -Pgenerate-docs' again"
|
54 | 116 | exit 1
|
55 | 117 | fi
|
56 |
| - - name: Validate helm chart linting |
57 |
| - run: | |
58 |
| - helm lint helm/flink-kubernetes-operator |
59 | 118 | - name: Tests in flink-kubernetes-operator
|
60 | 119 | run: |
|
61 | 120 | cd flink-kubernetes-operator
|
|
0 commit comments