This repository has been archived by the owner on Jan 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 222
106 lines (87 loc) · 2.5 KB
/
tests.yml
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: "Test Helm Charts"
on:
- push
- pull_request
env:
go-version: 1.21.5
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: ${{ env.go-version }}
- name: Install gojsontoyaml
run: go install github.com/brancz/gojsontoyaml@latest
- name: Set up chart-testing
uses: helm/[email protected]
- name: Run chart-testing (lint)
run: make lint
- name: Run shellcheck
run: make shellcheck
generate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: ${{ env.go-version }}
- name: Install gojsontoyaml
run: go install github.com/brancz/gojsontoyaml@latest
- name: Generate JSON Schema
run: make json-schema && git diff --exit-code
- name: Generate promscale alerts
run: make promscale-mixin && git diff --exit-code
test:
runs-on: ubuntu-latest
strategy:
matrix:
kube:
- "1.23"
- "1.24"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up chart-testing
uses: helm/[email protected]
- name: Start kuberenetes cluster
env:
KUBE_VERSION: ${{ matrix.kube }}
run: |
make start-kind
- name: Wait for cluster to finish bootstraping
run: kubectl wait --for=condition=Ready pods --all --all-namespaces --timeout=300s
- name: Check changed charts
id: changed-charts
run: |
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} | grep promscale || true)
if [ -n $changed ]; then
echo "CHARTS=${changed}" >> $GITHUB_OUTPUT
fi
- name: Pre-install DB
if: steps.changed-charts.outputs.CHARTS != ''
run: make install-db
- name: Run e2e chart-testing
run: make e2e
test-result:
name: End-to-End Test Results
if: always()
needs:
- test
runs-on: ubuntu-latest
steps:
- name: Mark the job as a success
if: needs.test.result == 'success'
run: exit 0
- name: Mark the job as a failure
if: needs.test.result != 'success'
run: exit 1