polymail 0.1.6

Unified email sending interface for multiple providers
Documentation
name: CI

on:
  push:
    branches: [master]
  pull_request:
    branches: [master]
  workflow_dispatch:

permissions:
  contents: read

env:
  CARGO_TERM_COLOR: always

jobs:
  check:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        # The two Lettermint reqwest backends are mutually exclusive.
        lettermint: [lettermint-reqwest-013, lettermint-reqwest-012]
    steps:
      - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
      - uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
        with:
          components: clippy
      - run: cargo check --no-default-features --features ${{ matrix.lettermint }},postmark,sendgrid,smtp,config
      - run: cargo clippy --no-default-features --features ${{ matrix.lettermint }},postmark,sendgrid,smtp,config --all-targets -- -D warnings

  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        lettermint: [lettermint-reqwest-013, lettermint-reqwest-012]
    steps:
      - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
      - uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
      - run: cargo test --no-default-features --features ${{ matrix.lettermint }},postmark,sendgrid,smtp,config

  smtp:
    runs-on: ubuntu-latest
    services:
      mailcrab:
        image: marlonb/mailcrab:v1.7.0
        ports:
          - 1025:1025
          - 1080:1080
    steps:
      - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
      - uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
      - name: Wait for mailcrab
        run: |
          for _ in $(seq 1 30); do
            curl -sf http://localhost:1080/api/messages >/dev/null && exit 0
            sleep 1
          done
          echo "mailcrab did not become ready" >&2
          exit 1
      # Runs the #[ignore]-d SMTP tests (unit + integration) against mailcrab.
      - run: cargo test --features smtp -- --ignored

  fmt:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
      - uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
        with:
          components: rustfmt
      - run: cargo fmt --check