self-host #16
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: Evaluation | |
# Run this workflow every time a new commit pushed to your repository | |
on: push | |
jobs: | |
unit_tests: | |
name: Unit Tests | |
runs-on: self-hosted | |
steps: | |
# Checks out a copy of your repository on the self-hosted machine | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pytest | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Launch DHT into background | |
run: | | |
python3 DHT.py --savelog & | |
PID=$! | |
sleep 1 | |
ps -p $PID > /dev/null | |
- name: Test with pytest | |
timeout-minutes: 3 | |
run: | | |
sleep 15 | |
pytest | |
- name: DHT Logs | |
if: ${{ failure() }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: DHT logs | |
path: dht.txt | |
retention-days: 1 |