Skip to content

docs: view documentation for new docker image #1937

docs: view documentation for new docker image

docs: view documentation for new docker image #1937

Workflow file for this run

name: CI
on:
workflow_call:
pull_request:
types: [ opened, synchronize, reopened, ready_for_review ]
workflow_dispatch:
push:
paths-ignore:
- '**.md'
- '**.kf'
branches:
- main
permissions:
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
# pull-requests: read
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.draft }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.24'
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v8
with:
# Require: The version of golangci-lint to use.
version: v2.2.1
args: --timeout=30m --issues-exit-code=0 --verbose
acceptance-test:
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.draft }}
steps:
- name: Clear cache
if: ${{ !env.ACT }} # skip during local actions testing
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
- name: Install Taskfile
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run Taskfile
run: task build
- name: Run Go Tests (with retry)
run: |
set -o errexit -o nounset -o pipefail
attempt=1
max_attempts=3
backoff=10
# Ensure Docker daemon is ready before first attempt
until docker info >/dev/null 2>&1; do
echo "Waiting for Docker daemon to be ready..."
sleep 2
done
while [ $attempt -le $max_attempts ]; do
echo "Test attempt $attempt of $max_attempts"
# Always try to cleanup lingering Kwil DB resources before each attempt
bash node/scripts/ci-cleanup.sh || true
# Additional cleanup only on retries
if [ $attempt -gt 1 ]; then
docker compose -f node/compose.yaml down -v || true
docker system prune -af --volumes || true
sleep 5
fi
if go test -short -p 1 -timeout=15m -count=1 -tags=kwiltest ./...; then
echo "✅ Tests passed on attempt $attempt"
break
else
echo "❌ Tests failed on attempt $attempt"
# Surface Docker diagnostics
echo "::group::Docker diagnostics"
docker ps -a || true
docker system df || true
docker info || true
echo "::endgroup::"
if [ $attempt -eq $max_attempts ]; then
echo "All test attempts failed"
exit 1
fi
attempt=$((attempt + 1))
echo "Waiting ${backoff}s before retry..."
sleep "$backoff"
backoff=$((backoff * 2))
fi
done
- name: Start Single-Node Stack
run: task single:start
- name: Wait for node to warm up
run: |
echo "⏳ giving the node 10s to initialize…"
sleep 10
- name: Run CI Tests Script
run: |
scripts/ci-tests.sh