|
| 1 | +name: Internal - Common Continuous Integration tasks |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: |
| 5 | + inputs: |
| 6 | + tag: |
| 7 | + description: "Tag Version (semver - x.x.x)" |
| 8 | + type: string |
| 9 | + required: false |
| 10 | + outputs: |
| 11 | + built-images: |
| 12 | + value: ${{ jobs.docker-build-images.outputs.built-images }} |
| 13 | + |
| 14 | +jobs: |
| 15 | + |
| 16 | + chart-testing: |
| 17 | + name: "Tests: helm chart" |
| 18 | + runs-on: self-hosted |
| 19 | + steps: |
| 20 | + - name: Checkout |
| 21 | + uses: actions/checkout@v4 |
| 22 | + with: |
| 23 | + fetch-depth: 0 |
| 24 | + - name: Install tools with asdf |
| 25 | + uses: asdf-vm/actions/install@v3 |
| 26 | + - uses: actions/setup-python@v5 |
| 27 | + with: |
| 28 | + python-version: '3.12' |
| 29 | + - name: Set up chart-testing |
| 30 | + uses: helm/chart-testing-action@v2.6.1 |
| 31 | + - name: Run chart-testing (list-changed) |
| 32 | + id: list-changed |
| 33 | + run: | |
| 34 | + changed="$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})" |
| 35 | + echo "changed=${changed}" |
| 36 | + if [[ -n "$changed" ]]; then |
| 37 | + echo "INFO: The chart has changes compared to the default branch" |
| 38 | + echo "changed=true" >> "$GITHUB_OUTPUT" |
| 39 | + else |
| 40 | + echo "INFO: The chart has no changes compared to the default branch" |
| 41 | + fi |
| 42 | + - name: Run chart-testing (lint) |
| 43 | + if: steps.list-changed.outputs.changed == 'true' |
| 44 | + run: ct lint --target-branch ${{ github.event.repository.default_branch }} |
| 45 | + - name: Create kind cluster |
| 46 | + if: steps.list-changed.outputs.changed == 'true' |
| 47 | + uses: helm/kind-action@v1.12.0 |
| 48 | + - name: Run chart-testing (install) |
| 49 | + if: steps.list-changed.outputs.changed == 'true' |
| 50 | + run: | |
| 51 | + ct install \ |
| 52 | + --target-branch ${{ github.event.repository.default_branch }} \ |
| 53 | + --wait" |
| 54 | + - name: show pods |
| 55 | + if: steps.list-changed.outputs.changed == 'true' |
| 56 | + run: | |
| 57 | + sleep 10 |
| 58 | + kubectl get pods -A |
0 commit comments