|
28 | 28 | - name: Test
|
29 | 29 | run: make test
|
30 | 30 |
|
| 31 | + e2e: |
| 32 | + runs-on: ubuntu-latest |
| 33 | + services: |
| 34 | + loki: |
| 35 | + image: grafana/loki:3.5.1 |
| 36 | + ports: |
| 37 | + - 3100:3100 |
| 38 | + options: >- |
| 39 | + --health-cmd "wget --no-verbose --tries=1 --spider http://localhost:3100/ready || exit 1" |
| 40 | + --health-interval 10s |
| 41 | + --health-timeout 5s |
| 42 | + --health-retries 5 |
| 43 | + steps: |
| 44 | + - name: Install Go |
| 45 | + uses: buildjet/setup-go@v5 |
| 46 | + with: |
| 47 | + go-version: 1.24.x |
| 48 | + - name: Checkout code |
| 49 | + uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 |
| 50 | + - uses: buildjet/cache@v4 |
| 51 | + with: |
| 52 | + path: | |
| 53 | + ~/go/pkg/mod |
| 54 | + ~/.cache/go-build |
| 55 | + .bin |
| 56 | + key: cache-${{ hashFiles('**/go.sum') }}-${{ hashFiles('.bin/*') }} |
| 57 | + restore-keys: | |
| 58 | + cache- |
| 59 | + - name: E2E Test |
| 60 | + run: | |
| 61 | + make ginkgo |
| 62 | + ginkgo -r tests/e2e/ |
| 63 | + env: |
| 64 | + DUTY_DB_DISABLE_RLS: 'true' |
| 65 | + LOKI_URL: http://localhost:3100 |
| 66 | + |
31 | 67 | test-prod:
|
32 | 68 | runs-on: ubuntu-latest
|
33 | 69 | timeout-minutes: 20
|
@@ -55,57 +91,56 @@ jobs:
|
55 | 91 | test-clickhouse:
|
56 | 92 | runs-on: ubuntu-latest
|
57 | 93 | steps:
|
58 |
| - - name: Checkout code |
59 |
| - uses: actions/checkout@v4 |
| 94 | + - name: Checkout code |
| 95 | + uses: actions/checkout@v4 |
60 | 96 |
|
61 |
| - - name: Kubernetes KinD Cluster |
62 |
| - uses: container-tools/kind-action@v2 |
| 97 | + - name: Kubernetes KinD Cluster |
| 98 | + uses: container-tools/kind-action@v2 |
63 | 99 |
|
64 |
| - - name: Install Helm |
65 |
| - uses: azure/setup-helm@v3 |
| 100 | + - name: Install Helm |
| 101 | + uses: azure/setup-helm@v3 |
66 | 102 |
|
67 |
| - - name: Verify cluster is ready |
68 |
| - run: | |
69 |
| - echo "Waiting for cluster to be ready..." |
70 |
| - kubectl wait --for=condition=Ready nodes --all --timeout=300s |
71 |
| - kubectl get nodes |
72 |
| - kubectl get pods -A |
| 103 | + - name: Verify cluster is ready |
| 104 | + run: | |
| 105 | + echo "Waiting for cluster to be ready..." |
| 106 | + kubectl wait --for=condition=Ready nodes --all --timeout=300s |
| 107 | + kubectl get nodes |
| 108 | + kubectl get pods -A |
73 | 109 |
|
74 |
| - - name: Build and push Docker image |
75 |
| - uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 |
76 |
| - with: |
77 |
| - context: . |
78 |
| - file: ./build/Dockerfile |
79 |
| - push: true |
80 |
| - tags: localhost:5000/flanksource/config-db:latest |
81 |
| - cache-from: type=registry,ref=docker.io/flanksource/config-db |
| 110 | + - name: Build and push Docker image |
| 111 | + uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 |
| 112 | + with: |
| 113 | + context: . |
| 114 | + file: ./build/Dockerfile |
| 115 | + push: true |
| 116 | + tags: localhost:5000/flanksource/config-db:latest |
| 117 | + cache-from: type=registry,ref=docker.io/flanksource/config-db |
82 | 118 |
|
83 |
| - - name: Package helm chart |
84 |
| - run: | |
85 |
| - helm dependency build ./chart |
86 |
| - helm package ./chart --version 1.0.0 |
| 119 | + - name: Package helm chart |
| 120 | + run: | |
| 121 | + helm dependency build ./chart |
| 122 | + helm package ./chart --version 1.0.0 |
87 | 123 |
|
88 |
| - - name: Install Helm chart |
89 |
| - run: | |
90 |
| - helm install config-db config-db-1.0.0.tgz \ |
91 |
| - --namespace default \ |
92 |
| - --set clickhouse.enabled=true \ |
93 |
| - --set imageRegistry="kind-registry:5000" |
| 124 | + - name: Install Helm chart |
| 125 | + run: | |
| 126 | + helm install config-db config-db-1.0.0.tgz \ |
| 127 | + --namespace default \ |
| 128 | + --set clickhouse.enabled=true \ |
| 129 | + --set imageRegistry="kind-registry:5000" |
94 | 130 |
|
95 |
| - - name: Check pod status |
96 |
| - run: | |
| 131 | + - name: Check pod status |
| 132 | + run: | |
97 | 133 | sleep 60
|
98 | 134 | kubectl get pods
|
99 | 135 | kubectl describe pods
|
100 | 136 | sleep 60
|
101 | 137 | kubectl get pods
|
102 | 138 | kubectl describe pods
|
103 |
| - |
104 | 139 |
|
105 |
| - - name: Run clickhouse fixture |
106 |
| - run: | |
107 |
| - kubectl cp fixtures/clickhouse.yaml config-db-0:/app/clickhouse.yaml |
108 |
| - kubectl exec -it config-db-0 -- /app/config-db run /app/clickhouse.yaml |
| 140 | + - name: Run clickhouse fixture |
| 141 | + run: | |
| 142 | + kubectl cp fixtures/clickhouse.yaml config-db-0:/app/clickhouse.yaml |
| 143 | + kubectl exec -it config-db-0 -- /app/config-db run /app/clickhouse.yaml |
109 | 144 |
|
110 | 145 | test-load:
|
111 | 146 | if: false # disabled for now
|
|
0 commit comments