Repository navigation
Use smee.io #434
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 | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.10", "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: | | |
| if [ "${{ matrix.python-version }}" = "3.10" ]; then | |
| uv sync --locked --all-extras | |
| else | |
| uv sync --locked --all-extras --all-packages | |
| fi | |
| - name: Type check | |
| run: | | |
| if [ "${{ matrix.python-version }}" = "3.10" ]; then | |
| uv run pyright fishjam | |
| else | |
| uv run pyright | |
| fi | |
| 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: | | |
| if [ "${{ matrix.python-version }}" = "3.10" ]; then | |
| uv sync --locked --all-extras | |
| else | |
| uv sync --locked --all-extras --all-packages | |
| fi | |
| - name: Start smee webhook relay | |
| run: | | |
| npm install -g smee-client | |
| nohup smee --url "${{ secrets.SMEE_WEBHOOK_URL }}" --target http://localhost:5000/webhook > smee.log 2>&1 & | |
| for i in $(seq 1 10); do | |
| if grep -q "Connected" smee.log; then break; fi | |
| sleep 1 | |
| done | |
| if ! grep -q "Connected" smee.log; then | |
| echo "smee-client failed to connect" | |
| cat smee.log | |
| exit 1 | |
| fi | |
| echo "smee-client is forwarding to http://localhost:5000/webhook" | |
| - name: Upload smee log | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: smee-log-py${{ matrix.python-version }} | |
| path: smee.log | |
| - name: Run tests | |
| run: uv run pytest | |
| env: | |
| WEBHOOK_URL: ${{ secrets.SMEE_WEBHOOK_URL }} | |
| FISHJAM_ID: ${{ secrets.CI_FISHJAM_ID }} | |
| FISHJAM_MANAGEMENT_TOKEN: ${{ secrets.CI_FISHJAM_MANAGEMENT_TOKEN }} |