-
Notifications
You must be signed in to change notification settings - Fork 4
92 lines (78 loc) · 2.78 KB
/
test-query-test.yaml
File metadata and controls
92 lines (78 loc) · 2.78 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
---
name: Test Query Test
# yamllint disable-line rule:truthy
on:
push:
branches: [main]
paths: [charts/query-test/**]
pull_request:
paths: [charts/query-test/**]
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@dda3372f752e03dde6b3237bc9431cdc2f7a02a2 # v5.0.0
- name: Set up chart-testing
uses: helm/chart-testing-action@6ec842c01de15ebb84c8627d2744a0c2f2755c9f # v2.8.0
- name: Run tests
working-directory: charts/query-test
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/query-test/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/query-test/tests/integration/${{ matrix.test }}"
DELETE_CLUSTER: true