Skip to content

feat: implement base code structure #8

feat: implement base code structure

feat: implement base code structure #8

Workflow file for this run

name: Test Unbound with Multiple Versions
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test-unbound:
runs-on: ubuntu-latest
strategy:
matrix:
include:
# TODO: Multiple versions of Unbound can be tested by adding more versions here.
# - fix: unbound.conf, test file's socket path
# - unbound-version: 1.18.0
# unbound-port: 5318
# unbound-control-port: 8918
# - unbound-version: 1.19.3
# unbound-port: 5319
# unbound-control-port: 8919
# - unbound-version: 1.20.0
# unbound-port: 5320
# unbound-control-port: 8920
# - unbound-version: 1.21.1
# unbound-port: 5321
# unbound-control-port: 8921
- unbound-version: 1.22.0
unbound-port: 5322
unbound-control-port: 8922
steps:
- uses: actions/checkout@v4
- name: Set up Docker Compose
run: sudo apt-get update && sudo apt-get install -y docker-compose
- name: Start Unbound containers
run: |
UNBOUND_VERSION=${{ matrix.unbound-version }} \
UNBOUND_DNS_PORT=${{ matrix.unbound-port }} \
UNBOUND_CONTROL_PORT=${{ matrix.unbound-control-port }} \
docker-compose up -d
- name: Verify Unbound is running
run: docker ps
- name: Wait for Unbound to become healthy
run: |
echo "Waiting for Unbound to be ready..."
for i in {1..30}; do
HEALTH=$(docker inspect --format='{{.State.Health.Status}}' unbound-${{ matrix.unbound-version }})
if [ "$HEALTH" == "healthy" ]; then
echo "Unbound is healthy!"
break
fi
echo "Unbound is not ready yet. Waiting..."
sleep 2
done
if [ "$HEALTH" != "healthy" ]; then
echo "Unbound did not become healthy in time."
exit 1
fi
- name: Set permissions for Unix socket
run: ls -Rl "$GITHUB_WORKSPACE/unbound-config"
- name: Test Unbound
run: |
dig @localhost -p ${{ matrix.unbound-port }} example.com
- name: Use Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 22.x
- name: Install dependencies
run: npm ci
- run: npm run test:it
- name: Stop Unbound
run: |
docker compose stop unbound-${{ matrix.unbound-version }}