Update GitHub Actions workflow #5
Workflow file for this run
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: Python 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: | | |
sudo apt-get update | |
sudo apt-get install -y docker.io | |
sudo systemctl start docker | |
sudo usermod -aG docker $USER | |
- name: Install system dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y git | |
- 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: | | |
poetry install --no-interaction --no-root | |
- 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/ |