maily 0.2.1

A library for easy, quick, and fault tolerant sending of emails.
Documentation
# Copyright (C) 2024 Daniel Mueller <deso@posteo.net>
# SPDX-License-Identifier: GPL-3.0-or-later

name: Test

on:
  pull_request:
  push:
  workflow_call:

env:
  CARGO_TERM_COLOR: always
  RUST_BACKTRACE: 1
  # Build without debug information enabled to decrease compilation time
  # and binary sizes in CI. This option is assumed to only have marginal
  # effects on the generated code, likely only in terms of section
  # arrangement. See
  # https://doc.rust-lang.org/cargo/reference/environment-variables.html
  # https://doc.rust-lang.org/rustc/codegen-options/index.html#debuginfo
  RUSTFLAGS: '-C debuginfo=0'

jobs:
  build:
    name: Build [${{ matrix.profile }} ${{ matrix.args }}]
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        rust: [stable]
        profile: [dev, release]
        args: ["--workspace --all-targets"]
        include:
          - rust: stable
            profile: dev
            # Make sure to build *without* `--workspace` or feature
            # unification may mean that `--no-default-features` goes
            # without effect.
            args: "--package=maily --no-default-features"
          - rust: stable
            profile: dev
            args: "--package=maily --features=config"
          - rust: stable
            profile: dev
            args: "--package=maily --features=pgp"
          - rust: stable
            profile: dev
            args: "--package=maily --features=tracing"
          - rust: stable
            profile: dev
            args: "--package=maily --features=config,pgp,tracing"
    steps:
    - uses: actions/checkout@v4
    - uses: dtolnay/rust-toolchain@master
      with:
        toolchain: ${{ matrix.rust }}
    - run: sudo apt-get install -y pkg-config nettle-dev
    - name: Build
      run: |
        cargo build --profile=${{ matrix.profile }} ${{ matrix.args }}
  test:
    name: Test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - run: sudo apt-get install -y pkg-config nettle-dev
      - name: Test
        run: cargo test --workspace --all-features
  clippy:
    name: Lint with clippy
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - run: sudo apt-get install -y pkg-config nettle-dev
      - run: cargo clippy --no-deps --workspace --all-targets --all-features --tests -- -A unknown_lints -A deprecated -D warnings
  rustdoc:
    name: Generate documentation
    runs-on: ubuntu-latest
    env:
      RUSTDOCFLAGS: '-D warnings -D rustdoc::broken_intra_doc_links'
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - run: cargo doc --no-deps