Skip to content

ci(github): add join nightly #1

ci(github): add join nightly

ci(github): add join nightly #1

Workflow file for this run

name: ci main
# Nightly action that tests joining omega as a full node.
on:
workflow_dispatch:
schedule:
- cron: "0 4 * * 1-5" # Weekdays at 4am UTC
permissions:
contents: read
pull-requests: read
jobs:
join:
runs-on: ubuntu-latest
steps:
- name: Run a full node
run: |
# As per public docs
curl -sSfL https://raw.githubusercontent.com/omni-network/omni/main/scripts/install_omni_cli.sh | sh -s
# init halo and geth
omni operator init-nodes --network=omega --moniker=ci-nightly --home=$(pwd)
# start halo and geth
docker compose up -d

Check failure on line 26 in .github/workflows/ci-join.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci-join.yml

Invalid workflow file

You have an error in your yaml syntax on line 26
- name: Wait for sync
run:
t0=$(date +%s) # Record the start time
while true; do
elapsed=$(($(date +%s) - t0)) # Calculate the elapsed time in seconds
# If more than 6 hours (21600 seconds) have passed, exit with a failure message
if [ $elapsed -gt 21600 ]; then
echo "Node not synced after 6 hours, failing"
exit 1
fi
# Get and print halo's health status
STATUS=$(docker inspect --format "{{json .State.Health.Status }}" halo | sed 's/"//g')
echo "$(date +'%H:%M:%S') status=${STATUS}"
# If the container is "healthy", it has synced, we are done
if [ "${STATUS}" == "healthy" ]; then
echo "Node synced"
break
fi
# Wait for 5 seconds before checking again
sleep 5
done
- name: Stop the node
if: always()
run: docker compose down