|
1 | 1 | --- |
2 | | - name: Lint and Test |
3 | | - on: |
4 | | - pull_request: |
5 | | - branches: |
6 | | - - main |
7 | | - workflow_dispatch: |
8 | | - |
9 | | - jobs: |
10 | | - chart-test: |
11 | | - runs-on: |
12 | | - - ubuntu-latest |
13 | | - |
14 | | - steps: |
15 | | - - name: Checkout |
16 | | - uses: actions/checkout@v4 |
17 | | - with: |
18 | | - fetch-depth: 0 |
19 | | - |
20 | | - - name: Set up Helm |
21 | | - uses: azure/setup-helm@v4.3.0 |
22 | | - with: |
23 | | - version: v3.16.4 |
24 | | - |
25 | | - - name: Set up python |
26 | | - uses: actions/setup-python@v5 |
27 | | - with: |
28 | | - python-version: '3.13' |
29 | | - check-latest: true |
30 | | - |
31 | | - - name: Setup Chart Linting |
32 | | - id: lint |
33 | | - uses: helm/chart-testing-action@v2.7.0 |
34 | | - |
35 | | - - name: Chart-testing (list-changed) |
36 | | - id: list-changed |
37 | | - run: | |
38 | | - changed=$(ct --config ./.github/configs/ct-lint.yaml list-changed --target-branch ${{ github.event.repository.default_branch }}) |
39 | | - charts=$(echo "$changed" | tr '\n' ' ' | xargs) |
40 | | - if [[ -n "$changed" ]]; then |
41 | | - echo "changed=true" >> "$GITHUB_OUTPUT" |
42 | | - echo "changed_charts=$charts" >> "$GITHUB_OUTPUT" |
43 | | - fi |
44 | | -
|
45 | | - - name: Chart-testing (lint) |
46 | | - run: ct lint --debug --config ./.github/configs/ct-lint.yaml --lint-conf ./.github/configs/lintconf.yaml --target-branch ${{ github.event.repository.default_branch }} |
47 | | - |
48 | | - - name: Create kind cluster |
49 | | - uses: helm/kind-action@v1.12.0 |
50 | | - if: steps.list-changed.outputs.changed == 'true' |
51 | | - with: |
52 | | - config: ./.github/configs/kind-config.yaml |
53 | | - |
54 | | - - name: Chart-testing (install) |
55 | | - run: ct install --config ./.github/configs/ct-install.yaml |
56 | | - if: steps.list-changed.outputs.changed == 'true' |
| 2 | +name: Lint and Test |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + workflow_dispatch: |
| 8 | + |
| 9 | +jobs: |
| 10 | + chart-test: |
| 11 | + runs-on: |
| 12 | + - ubuntu-latest |
| 13 | + |
| 14 | + steps: |
| 15 | + - name: Checkout |
| 16 | + uses: actions/checkout@v4 |
| 17 | + with: |
| 18 | + fetch-depth: 0 |
| 19 | + |
| 20 | + - name: Set up Helm |
| 21 | + uses: azure/setup-helm@v4.3.0 |
| 22 | + with: |
| 23 | + version: v3.16.4 |
| 24 | + |
| 25 | + - name: Set up python |
| 26 | + uses: actions/setup-python@v5 |
| 27 | + with: |
| 28 | + python-version: '3.13' |
| 29 | + check-latest: true |
| 30 | + |
| 31 | + - name: Setup Chart Linting |
| 32 | + id: lint |
| 33 | + uses: helm/chart-testing-action@v2.7.0 |
| 34 | + |
| 35 | + - name: Chart-testing (list-changed) |
| 36 | + id: list-changed |
| 37 | + run: | |
| 38 | + changed=$(ct --config ./.github/configs/ct-lint.yaml list-changed --target-branch ${{ github.event.repository.default_branch }}) |
| 39 | + charts=$(echo "$changed" | tr '\n' ' ' | xargs) |
| 40 | + if [[ -n "$changed" ]]; then |
| 41 | + echo "changed=true" >> "$GITHUB_OUTPUT" |
| 42 | + echo "changed_charts=$charts" >> "$GITHUB_OUTPUT" |
| 43 | + fi |
| 44 | +
|
| 45 | + - name: Chart-testing (lint) |
| 46 | + run: ct lint --debug --config ./.github/configs/ct-lint.yaml --lint-conf ./.github/configs/lintconf.yaml --target-branch ${{ github.event.repository.default_branch }} |
| 47 | + |
| 48 | + - name: Create kind cluster |
| 49 | + uses: helm/kind-action@v1.12.0 |
| 50 | + if: steps.list-changed.outputs.changed == 'true' |
| 51 | + with: |
| 52 | + config: ./.github/configs/kind-config.yaml |
| 53 | + |
| 54 | + - name: Chart-testing (install) |
| 55 | + run: ct install --config ./.github/configs/ct-install.yaml |
| 56 | + if: steps.list-changed.outputs.changed == 'true' |
0 commit comments