name: E2E Tests
on:
push:
branches: [main]
pull_request_target:
branches: [main]
workflow_call:
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
PROTOC_VERSION: '3.25.3'
jobs:
e2e:
name: E2E Tests
runs-on: ubuntu-latest
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:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2026-01-30
- name: Install protoc
uses: taiki-e/install-action@v2
with:
tool: protoc@${{ env.PROTOC_VERSION }}
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
- 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: Run E2E tests
env:
MOCK_SERVER_URL: "wss://127.0.0.1:8080/ws/chat"
RUST_LOG: info
run: cargo test -p e2e-tests -- --no-capture