whatsapp-rust 0.5.0

Rust client for WhatsApp Web
Documentation
name: "Copilot Setup Steps"

on:
  workflow_dispatch:
  push:
    paths:
      - .github/workflows/copilot-setup-steps.yml
  pull_request:
    paths:
      - .github/workflows/copilot-setup-steps.yml

jobs:
  copilot-setup-steps:
    runs-on: ubuntu-latest
    permissions:
      contents: read
    services:
      mock-server:
        image: ghcr.io/whiskeysockets-devtools/bartender:latest
        credentials:
          username: ${{ github.actor }}
          password: ${{ secrets.BARTENDER_GHCR_TOKEN }}
        ports:
          - 8080:8080
        env:
          CHATSTATE_TTL_SECS: "3"
        options: --log-driver none
    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Set up Rust
        uses: dtolnay/rust-toolchain@master
        with:
          toolchain: nightly-2026-01-30

      - name: Cache install-action tools
        uses: actions/cache@v4
        with:
          path: |
            ~/.install-action
          key: ${{ runner.os }}-install-action-${{ hashFiles('.github/workflows/copilot-setup-steps.yml') }}
          restore-keys: |
            ${{ runner.os }}-install-action-

      - name: Install tools (valgrind, iai-callgrind-runner)
        uses: taiki-e/install-action@v2
        with:
          tool: valgrind,iai-callgrind-runner@0.16.1

      - name: Cache Rust dependencies
        uses: Swatinem/rust-cache@v2

      - name: Fetch Rust dependencies
        run: cargo fetch

      - name: Wait for mock server
        run: |
          for i in $(seq 1 30); do
            if curl -sk https://localhost:8080/ > /dev/null 2>&1; then
              echo "Mock server is ready"
              exit 0
            fi
            sleep 1
          done
          echo "Mock server failed to become ready"
          exit 1

      - name: Export mock server URL
        run: |
          echo "MOCK_SERVER_URL=wss://127.0.0.1:8080/ws/chat" >> "$GITHUB_ENV"