Skip to content

healthcheck

healthcheck #13

Workflow file for this run

name: CI
on:
push:
branches: ['*']
pull_request:
branches: ['*']
jobs:
test:
strategy:
fail-fast: false
matrix:
pg: [14, 13, 12, 11]
check_code: ["false", "clang"]
name: Test clickhouse_fdw
runs-on: ubuntu-latest
container: docker:latest
services:
clickhouse:
image: clickhouse/clickhouse-server:latest
ports:
- 8123:8123
- 9000:9000
options: >-
--health-cmd "clickhouse-client --host localhost --query 'SELECT 1'"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2
- name: Wait for ClickHouse to be ready
run: |
for i in {1..30}; do
if curl 'http://localhost:8123/' --data-binary "SELECT 1" 2>/dev/null; then
echo "ClickHouse is up!"
exit 0
fi
echo "Waiting for ClickHouse..."
sleep 1
done
echo "Timed out waiting for ClickHouse"
exit 1
- name: Build an image with the source code
run: docker-compose -f docker-compose-extra.yml build --build-arg CHECK_CODE=${{ matrix.check_code }} --build-arg PG_VERSION=${{ matrix.pg }} tests
- name: Run the tests
run: docker-compose -f docker-compose-extra.yml run tests