-
Notifications
You must be signed in to change notification settings - Fork 26
82 lines (64 loc) · 2.77 KB
/
Copy pathtest.yaml
File metadata and controls
82 lines (64 loc) · 2.77 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
name: Test Charts
on: pull_request
jobs:
check-readme:
runs-on: ubuntu-latest
env:
GO111MODULE: on
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: '3.x'
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # pin@v3
with:
go-version: ^1
- name: Setup helm-docs
run: go install github.com/norwoodj/helm-docs/cmd/helm-docs@latest
- name: Run pre-commit
uses: pre-commit/action@1b06ec171f2f6faa71ed760c4042bd969e4f8b43 # pin@v3.0.1
test:
runs-on: ubuntu-latest
strategy:
matrix:
postgres-version: ['13', '14', '15', '16', '17']
name: Test with PostgreSQL ${{ matrix.postgres-version }}
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v5.0.1 # pin@v4.3.0
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: '3.x'
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.8.0
- name: Add Helm repositories
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
- name: Run chart-testing (lint)
run: ct lint --config ct.yaml
- name: Create KIND Cluster
uses: helm/kind-action@ef37e7f390d99f746eb8b610417061a60e82a6cc # pin@v1.12.0
- name: Deploy PostgreSQL for testing
run: |
# Replace the PostgreSQL image version in the manifest
sed "s/postgres:15-alpine/postgres:${{ matrix.postgres-version }}-alpine/g" .github/ci-postgres.yaml | kubectl apply -f -
echo "Waiting for PostgreSQL ${{ matrix.postgres-version }} to be ready..."
kubectl wait --for=condition=ready pod -l app=postgres --timeout=120s
echo "PostgreSQL deployment status:"
kubectl get pods -l app=postgres
kubectl get svc postgres
# Verify PostgreSQL is accepting connections
echo "Verifying PostgreSQL ${{ matrix.postgres-version }} connectivity..."
kubectl run postgres-test --image=postgres:${{ matrix.postgres-version }}-alpine --rm -i --restart=Never --env="PGPASSWORD=pactbroker-password" -- \
psql -h postgres -U pactbroker -d pactbroker -c "SELECT version();" || true
# Show the secrets created for the Pact Broker
echo "Available secrets:"
kubectl get secrets pact-broker-db-secret
- name: Run chart-testing (install)
run: ct install --config ct-install.yaml