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:
lettermint: [lettermint-reqwest-013, lettermint-reqwest-012]
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 - uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 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 - uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 - 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 - uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 - 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
- run: cargo test --features smtp -- --ignored
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 - uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 with:
components: rustfmt
- run: cargo fmt --check