name: CI

on:
  push:
    branches: [main, master]
  pull_request:

jobs:
  test:
    runs-on: ubuntu-latest
    services:
      redis:
        image: redis:7-alpine
        ports:
          - 6379:6379
        options: >-
          --health-cmd "redis-cli ping"
          --health-interval 2s
          --health-timeout 5s
          --health-retries 5

    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - name: Tests (unit + lib)
        run: cargo test --all-features
      - name: Integration tests (Redis)
        run: cargo test --all-features --test queue_integration -- --ignored
        env:
          REDIS_URL: redis://127.0.0.1:6379
