Chore: Bump middleware to v0.2.4
#155
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: Quickstart Tests | |
on: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
setup: | |
runs-on: ubuntu-latest | |
outputs: | |
agent_names: ${{ steps.find-agents.outputs.names }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Docker | |
run: | | |
# Stop and remove existing Docker installations | |
sudo systemctl stop docker || true | |
sudo systemctl stop docker.socket || true | |
# Clean existing installations | |
sudo apt-get remove -y docker docker-engine docker.io containerd runc | |
sudo apt-get update | |
# Install prerequisites | |
sudo apt-get install -y \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
gnupg \ | |
lsb-release jq | |
# Add Docker's GPG key | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg | |
# Add Docker repository | |
echo \ | |
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \ | |
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | |
# Install Docker | |
sudo apt-get update | |
sudo apt-get install -y docker-ce docker-ce-cli containerd.io | |
# Get current user info | |
CURRENT_USER=$(id -u) | |
CURRENT_GROUP=$(id -g) | |
# Start Docker service | |
sudo systemctl start docker | |
- id: find-agents | |
run: | | |
NAMES=$(ls configs/config_*.json | sed 's/configs\/config_//' | sed 's/\.json//' | jq -R -s -c 'split("\n")[:-1]') | |
echo "Found agents: $NAMES" | |
echo "names=$NAMES" >> $GITHUB_OUTPUT | |
test: | |
needs: setup | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
agent: ${{ fromJson(needs.setup.outputs.agent_names) }} | |
fail-fast: false | |
env: | |
GNOSIS_RPC_URL: ${{ secrets.GNOSIS_RPC_URL }} | |
MODIUS_RPC_URL: ${{ secrets.MODIUS_RPC_URL }} | |
OPTIMISM_RPC_URL: ${{ secrets.OPTIMISM_RPC_URL }} | |
BASE_RPC_URL: ${{ secrets.BASE_RPC_URL }} | |
TEST_PASSWORD: ${{ secrets.TEST_PASSWORD }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Install system dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y git | |
- name: Clean Python cache | |
run: | | |
sudo rm -rf ~/.cache/pip | |
sudo rm -rf ~/.cache/poetry | |
sudo rm -rf .pytest_cache | |
sudo rm -rf .venv | |
sudo rm -rf poetry.lock | |
- name: Install Poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 - | |
- name: Configure Poetry | |
run: | | |
poetry config virtualenvs.create true | |
poetry config virtualenvs.in-project true | |
- name: Create .env file | |
run: | | |
echo "GNOSIS_RPC_URL=${GNOSIS_RPC_URL}" > .env | |
echo "MODIUS_RPC_URL=${MODIUS_RPC_URL}" >> .env | |
echo "OPTIMISM_RPC_URL=${OPTIMISM_RPC_URL}" >> .env | |
echo "BASE_RPC_URL=${BASE_RPC_URL}" >> .env | |
echo "TEST_PASSWORD=${TEST_PASSWORD}" >> .env | |
- name: Install project dependencies | |
run: | | |
python -m pip install --upgrade pip | |
poetry env use python3.10 | |
poetry install --no-interaction | |
- name: Run test | |
run: poetry run pytest -v tests/test_run_service.py -s --log-cli-level=INFO -k ${{ matrix.agent }} | |
- name: Debug container failure | |
if: failure() | |
run: | | |
docker ps -a | |
for container in $(docker ps -aq); do | |
echo "=== Logs for $container ===" | |
docker logs $container | |
done | |
test-staking: | |
runs-on: ubuntu-latest | |
env: | |
GNOSIS_RPC_URL: ${{ secrets.GNOSIS_RPC_URL }} | |
MODIUS_RPC_URL: ${{ secrets.MODIUS_RPC_URL }} | |
OPTIMISM_RPC_URL: ${{ secrets.OPTIMISM_RPC_URL }} | |
BASE_RPC_URL: ${{ secrets.BASE_RPC_URL }} | |
TEST_PASSWORD: ${{ secrets.TEST_PASSWORD }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Install system dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y git | |
- name: Clean Python cache | |
run: | | |
sudo rm -rf ~/.cache/pip | |
sudo rm -rf ~/.cache/poetry | |
sudo rm -rf .pytest_cache | |
sudo rm -rf .venv | |
sudo rm -rf poetry.lock | |
- name: Install Poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 - | |
- name: Configure Poetry | |
run: | | |
poetry config virtualenvs.create true | |
poetry config virtualenvs.in-project true | |
- name: Create .env file | |
run: | | |
echo "GNOSIS_RPC_URL=${GNOSIS_RPC_URL}" > .env | |
echo "MODIUS_RPC_URL=${MODIUS_RPC_URL}" >> .env | |
echo "OPTIMISM_RPC_URL=${OPTIMISM_RPC_URL}" >> .env | |
echo "BASE_RPC_URL=${BASE_RPC_URL}" >> .env | |
echo "TEST_PASSWORD=${TEST_PASSWORD}" >> .env | |
- name: Install project dependencies | |
run: | | |
python -m pip install --upgrade pip | |
poetry env use python3.10 | |
poetry install --no-interaction | |
- name: Run test | |
run: poetry run pytest -v tests/test_staking_service.py -s --log-cli-level=INFO | |
- name: Debug container failure | |
if: failure() | |
run: | | |
docker ps -a | |
for container in $(docker ps -aq); do | |
echo "=== Logs for $container ===" | |
docker logs $container | |
done |