Fix delay test #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: Test Delay | |
| # yamllint disable-line rule:truthy | |
| on: | |
| push: | |
| branches: [main] | |
| paths: [charts/delay/**] | |
| pull_request: | |
| paths: [charts/delay/**] | |
| workflow_dispatch: | |
| permissions: {} | |
| jobs: | |
| run-unit-tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: 'false' | |
| - name: Set up Helm | |
| uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4.3.1 | |
| - name: Set up chart-testing | |
| uses: helm/chart-testing-action@6ec842c01de15ebb84c8627d2744a0c2f2755c9f # v2.8.0 | |
| - name: Run tests | |
| working-directory: charts/delay | |
| run: make test | |
| list-integration-tests: | |
| name: List tests | |
| runs-on: ubuntu-latest | |
| outputs: | |
| tests: ${{ steps.list_tests.outputs.tests }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: 'false' | |
| - name: List tests | |
| id: list_tests | |
| working-directory: charts/delay/tests/integration | |
| run: | | |
| tests=$(find . -name test-plan.yaml -exec dirname {} \;) | |
| echo "Tests: ${tests}" | |
| echo "tests=$(echo "${tests}" | jq --raw-input --slurp --compact-output 'split("\n") | map(select(. != ""))')" >> "${GITHUB_OUTPUT}" | |
| run-integration-tests: | |
| name: Integration Test | |
| needs: list-integration-tests | |
| runs-on: ubuntu-latest | |
| if: needs.list-integration-tests.outputs.tests != '[]' | |
| strategy: | |
| matrix: | |
| test: ${{ fromJson(needs.list-integration-tests.outputs.tests) }} | |
| fail-fast: false | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: 'false' | |
| path: source | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: 'false' | |
| repository: grafana/helm-chart-toolbox | |
| path: helm-chart-toolbox | |
| - name: Install Flux CLI | |
| uses: fluxcd/flux2/action@871be9b40d53627786d3a3835a3ddba1e3234bd2 # v2.8.3 | |
| - name: Install Kind CLI | |
| uses: helm/kind-action@ef37e7f390d99f746eb8b610417061a60e82a6cc # v1.14.0 | |
| with: | |
| install_only: true | |
| - name: Install Minikube CLI | |
| uses: medyagh/setup-minikube@e9e035a86bbc3caea26a450bd4dbf9d0c453682e # v0.0.21 | |
| with: | |
| start: false | |
| - name: Run test | |
| run: helm-chart-toolbox/tools/helm-test/helm-test "${TEST_DIRECTORY}" | |
| env: | |
| TEST_DIRECTORY: "source/charts/delay/tests/integration/${{ matrix.test }}" | |
| DELETE_CLUSTER: true |