Skip to content

Feat/updating test script #16

Feat/updating test script

Feat/updating test script #16

Workflow file for this run

name: Qucikstart Tests
on:
push:
branches:
- feat/updating_test_script
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
env:
RPC_URL: ${{ secrets.RPC_URL }}
BACKUP_WALLET: ${{ secrets.BACKUP_WALLET }}
TEST_PASSWORD: ${{ secrets.TEST_PASSWORD }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
STAKING_CHOICE: ${{ secrets.STAKING_CHOICE }}
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Set up Docker
run: |
# Remove any conflicting packages
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do
sudo apt-get remove $pkg || true
done
# Add Docker's official GPG key
sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
# Add the repository to Apt sources
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" 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 docker-buildx-plugin docker-compose-plugin
# Verify installation
sudo docker --version
- 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 "RPC_URL=${RPC_URL}" > .env
echo "BACKUP_WALLET=${BACKUP_WALLET}" >> .env
echo "TEST_PASSWORD=${TEST_PASSWORD}" >> .env
echo "PRIVATE_KEY=${PRIVATE_KEY}" >> .env
echo "STAKING_CHOICE=${STAKING_CHOICE}" >> .env
- name: Install project dependencies
run: |
# Ensure we're using python 3.10
python -m pip install --upgrade pip
poetry env use python3.10
poetry install --no-interaction
- name: Run tests
run: |
poetry run pytest -v tests/test_run_service.py -s --log-cli-level=INFO
- name: Upload test logs
if: always()
uses: actions/upload-artifact@v3
with:
name: test-logs
path: logs/