fix: start relay before tests in CI #3
This file contains hidden or 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: Test Suite | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.11"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r relay/requirements.txt | |
| pip install pytest pytest-cov pytest-asyncio | |
| - name: Start relay for tests | |
| run: | | |
| python relay/relay_server_v2.py & | |
| sleep 3 | |
| echo "✅ Relay ready on :8198" | |
| - name: Run relay tests | |
| run: | | |
| python -m pytest relay/test_relay_nips.py -v --asyncio-mode=auto --cov=relay --cov-report=term-missing | |
| - name: Kill relay | |
| run: | | |
| pkill -f relay_server_v2.py || true | |
| - name: Run nostr-sse-client tests (if any) | |
| run: | | |
| python -m pytest nostr_sse_client_pkg/ -v || true |