Add moq publisher/subscriber endpoints #416
Workflow file for this run
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: CI | |
| on: [push] | |
| jobs: | |
| lint-and-format: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: true | |
| - name: Install project dependencies | |
| run: uv sync --locked --all-extras --all-packages | |
| - name: Format Check | |
| run: uv run format_check | |
| - name: Lint | |
| run: uv run lint | |
| type-check: | |
| runs-on: ubuntu-latest | |
| strategy: &strategy | |
| matrix: | |
| python-version: ["3.11", "3.12", "3.13"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| enable-cache: true | |
| - name: Install project dependencies | |
| run: uv sync --locked --all-extras --all-packages | |
| - name: Type check | |
| run: uv run pyright | |
| test: | |
| runs-on: ubuntu-latest | |
| needs: [lint-and-format] | |
| strategy: *strategy | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| enable-cache: true | |
| - name: Install project dependencies | |
| run: uv sync --locked --all-extras --all-packages | |
| - name: Initialize Localtunnel | |
| id: tunnel | |
| run: | | |
| npm install -g localtunnel | |
| npm exec localtunnel -- --port 5000 > tunnel.log 2>&1 & | |
| # Poll for the URL | |
| TIMEOUT=15 | |
| ELAPSED=0 | |
| echo "Waiting for localtunnel to generate URL..." | |
| while ! grep -q "https://" tunnel.log; do | |
| if [ $ELAPSED -ge $TIMEOUT ]; then | |
| echo "Error: Localtunnel timed out after ${TIMEOUT}s" | |
| cat tunnel.log | |
| exit 1 | |
| fi | |
| sleep 1 | |
| ELAPSED=$((ELAPSED + 1)) | |
| done | |
| TUNNEL_URL=$(grep -o 'https://[^ ]*' tunnel.log | head -n 1) | |
| echo "url=$TUNNEL_URL" >> $GITHUB_OUTPUT | |
| echo "Localtunnel is live at: $TUNNEL_URL" | |
| - name: Upload localtunnel log | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: localtunnel-log-py${{ matrix.python-version }} | |
| path: tunnel.log | |
| - name: Run tests | |
| run: uv run pytest | |
| env: | |
| WEBHOOK_SERVER_URL: ${{ steps.tunnel.outputs.url }} | |
| FISHJAM_ID: ${{ secrets.CI_FISHJAM_ID }} | |
| FISHJAM_MANAGEMENT_TOKEN: ${{ secrets.CI_FISHJAM_MANAGEMENT_TOKEN }} |