fix: retry commit until success #122
This file contains 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: CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
services: | |
databend: | |
# image: datafuselabs/databend-query | |
image: datafuselabs/databend | |
env: | |
QUERY_DEFAULT_USER: databend | |
QUERY_DEFAULT_PASSWORD: databend | |
MINIO_ENABLED: true | |
ports: | |
- 8000:8000 | |
- 9000:9000 | |
# https://github.com/bitnami/containers/issues/4315#issuecomment-1545589060 | |
zookeeper: | |
image: docker.io/bitnami/zookeeper:3.8 | |
ports: | |
- 2181:2181 | |
env: | |
ALLOW_ANONYMOUS_LOGIN: yes | |
kafka: | |
image: bitnami/kafka:3.2 | |
ports: | |
- 9092:9092 | |
options: >- | |
--health-cmd "kafka-broker-api-versions.sh --version" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
env: | |
KAFKA_ENABLE_KRAFT: no | |
ALLOW_PLAINTEXT_LISTENER: yes | |
KAFKA_CFG_ZOOKEEPER_CONNECT: zookeeper:2181 | |
KAFKA_CFG_LISTENERS: PLAINTEXT://:9092,PLAINTEXT_HOST://:29092 | |
KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT | |
KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://127.0.0.1:9092,PLAINTEXT_HOST://127.0.0.1:9092 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Verify Service Running | |
run: | | |
sleep 60 | |
cid=$(docker ps -a | grep databend | cut -d' ' -f1) | |
docker logs ${cid} | |
cid=$(docker ps -a | grep kafka | cut -d' ' -f1) | |
docker logs ${cid} | |
netstat -nlp | |
curl -v http://localhost:8000/v1/health | |
- name: Test | |
env: | |
TEST_DATABEND_DSN: "http://databend:databend@localhost:8000/default" | |
TEST_KAFKA_BROKER: "localhost:9092" | |
run: | | |
go test -v -p 1 -cover ./... |