diff --git a/.cirrus.yml b/.cirrus.yml deleted file mode 100644 index eab595f..0000000 --- a/.cirrus.yml +++ /dev/null @@ -1,22 +0,0 @@ -task: - name: freebsd-stable - freebsd_instance: - image_family: freebsd-12-1 - env: - RUST_BACKTRACE: 1 - setup_script: - - pkg install -y curl git - - curl https://sh.rustup.rs -sSf --output rustup.sh - - sh rustup.sh -y - - . $HOME/.cargo/env - check_script: - - . $HOME/.cargo/env - - cargo check --all-targets --all-features - build_script: - - . $HOME/.cargo/env - - cargo build --all-targets --verbose --all-features - test_script: - - . $HOME/.cargo/env - - cargo test --examples --all-features - - cargo test --doc --all-features - - cargo test --lib --all-features diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..3675f66 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,34 @@ +on: + push: + branches: [master] + pull_request: +name: coverage +jobs: + test: + runs-on: ubuntu-latest + container: + image: xd009642/tarpaulin + options: --security-opt seccomp=unconfined + steps: + - uses: actions/checkout@v2 + - name: Generate code coverage + run: | + cargo tarpaulin --verbose --timeout 120 --out Xml + env: + TEST_HOST: greenmail + - name: Upload to codecov.io + uses: codecov/codecov-action@v2 + with: + fail_ci_if_error: true + services: + greenmail: + image: greenmail/standalone:1.6.3 + ports: + - 3025:3025 + - 3110:3110 + - 3143:3143 + - 3465:3465 + - 3993:3993 + - 3995:3995 + env: + GREENMAIL_OPTS: "-Dgreenmail.setup.test.all -Dgreenmail.hostname=0.0.0.0 -Dgreenmail.auth.disabled -Dgreenmail.verbose" diff --git a/.github/workflows/features.yml b/.github/workflows/features.yml new file mode 100644 index 0000000..dd787cb --- /dev/null +++ b/.github/workflows/features.yml @@ -0,0 +1,25 @@ +on: + push: + branches: [master] + pull_request: +name: cargo hack +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + - uses: actions/checkout@v2 + - name: Install cargo-hack + uses: actions-rs/install@v0.1 + with: + crate: cargo-hack + version: latest + use-tool-cache: true + - name: cargo hack + uses: actions-rs/cargo@v1 + with: + command: hack + args: --feature-powerset check --all-targets diff --git a/.github/workflows/minimal.yml b/.github/workflows/minimal.yml new file mode 100644 index 0000000..753211e --- /dev/null +++ b/.github/workflows/minimal.yml @@ -0,0 +1,40 @@ +on: + push: + branches: [master] + pull_request: +name: With dependencies at minimal versions +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + - uses: actions/checkout@v2 + - name: cargo update -Zminimal-versions + uses: actions-rs/cargo@v1 + with: + command: update + toolchain: nightly + args: -Zminimal-versions + - name: cargo test + uses: actions-rs/cargo@v1 + with: + command: test + services: + greenmail: + image: greenmail/standalone:1.6.3 + ports: + - 3025:3025 + - 3110:3110 + - 3143:3143 + - 3465:3465 + - 3993:3993 + - 3995:3995 + env: + GREENMAIL_OPTS: "-Dgreenmail.setup.test.all -Dgreenmail.hostname=0.0.0.0 -Dgreenmail.auth.disabled -Dgreenmail.verbose" diff --git a/.github/workflows/msrv.yml b/.github/workflows/msrv.yml new file mode 100644 index 0000000..90a3a69 --- /dev/null +++ b/.github/workflows/msrv.yml @@ -0,0 +1,19 @@ +on: + push: + branches: [master] + pull_request: +name: Minimum Supported Rust Version +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: 1.46.0 # bitflags requires 1.46+ + override: true + - uses: actions/checkout@v2 + - name: cargo +1.46.0 check + uses: actions-rs/cargo@v1 + with: + command: check diff --git a/.github/workflows/os-check.yml b/.github/workflows/os-check.yml new file mode 100644 index 0000000..bbcb475 --- /dev/null +++ b/.github/workflows/os-check.yml @@ -0,0 +1,24 @@ +on: + push: + branches: [master] + pull_request: +name: cargo check +jobs: + os-check: + runs-on: ${{ matrix.os }} + name: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [macos-latest, windows-latest] + steps: + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + - uses: actions/checkout@v2 + - name: cargo check + uses: actions-rs/cargo@v1 + with: + command: check + args: --all-features --all-targets diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml new file mode 100644 index 0000000..34c058e --- /dev/null +++ b/.github/workflows/style.yml @@ -0,0 +1,36 @@ +on: + push: + branches: [master] + pull_request: +name: lint +jobs: + style: + runs-on: ubuntu-latest + name: ${{ matrix.toolchain }} + strategy: + fail-fast: false + matrix: + toolchain: [stable, beta] + steps: + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.toolchain }} + components: rustfmt, clippy + - uses: actions/checkout@v2 + - name: cargo fmt --check + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --check + - name: cargo doc + uses: actions-rs/cargo@v1 + if: always() + with: + command: doc + args: --no-deps --all-features + - name: cargo clippy + uses: actions-rs/clippy-check@v1 + if: always() + with: + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..5c862d5 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,34 @@ +on: + push: + branches: [master] + pull_request: +name: cargo test +jobs: + test: + runs-on: ubuntu-latest + name: ${{ matrix.toolchain }} + strategy: + matrix: + toolchain: [stable, beta, nightly] + steps: + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.toolchain }} + - uses: actions/checkout@v2 + - name: cargo test + uses: actions-rs/cargo@v1 + with: + command: test + services: + greenmail: + image: greenmail/standalone:1.6.3 + ports: + - 3025:3025 + - 3110:3110 + - 3143:3143 + - 3465:3465 + - 3993:3993 + - 3995:3995 + env: + GREENMAIL_OPTS: "-Dgreenmail.setup.test.all -Dgreenmail.hostname=0.0.0.0 -Dgreenmail.auth.disabled -Dgreenmail.verbose" diff --git a/Cargo.toml b/Cargo.toml index caa9fc7..91f544d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ default = ["native-tls"] native-tls = { version = "0.2.2", optional = true } rustls-connector = { version = "0.13.1", optional = true } regex = "1.0" -bufstream = "0.1" +bufstream = "0.1.3" imap-proto = "0.14.1" nom = { version = "6.0", default-features = false } base64 = "0.13" @@ -30,11 +30,17 @@ lazy_static = "1.4" ouroboros = "0.9.5" [dev-dependencies] -lettre = "0.9" -lettre_email = "0.9" +lettre = "0.9.2" +lettre_email = "0.9.2" rustls-connector = "0.13.0" structopt = "0.3" +# to make -Zminimal-versions work +encoding = "0.2.32" +hostname = "0.1.3" +failure = "0.1.8" +mime = "0.3.4" + [[example]] name = "basic" required-features = ["default"] diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index b7a422d..0000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,109 +0,0 @@ -jobs: - - job: test - displayName: cargo test --{examples,doc,lib} - strategy: - matrix: - Linux-stable: - vmImage: ubuntu-latest - rust: stable - Linux-beta: - vmImage: ubuntu-latest - rust: beta - Linux-nightly: - vmImage: ubuntu-latest - rust: nightly - MacOS: - vmImage: macOS-10.14 - rust: stable - Windows: - vmImage: windows-2019 - rust: stable - continueOnError: $[eq(variables.rust, 'nightly')] - pool: - vmImage: $(vmImage) - steps: - - template: install-rust.yml@templates - parameters: - rust: $(rust) - - script: cargo check --all-targets --all-features - displayName: cargo check - - script: cargo test --examples --all-features - displayName: cargo test --examples - - script: cargo test --doc --all-features - displayName: cargo test --doc - - script: cargo test --lib --all-features - displayName: cargo test --lib - - script: | - set -e - rustup component add rustfmt - cargo fmt --all -- --check - displayName: cargo fmt --check - condition: and(eq( variables['rust'], 'beta' ), eq( variables['Agent.OS'], 'Linux' )) - - script: | - set -e - rustup component add clippy - cargo clippy -- -D warnings - displayName: cargo clippy - condition: and(eq( variables['rust'], 'beta' ), eq( variables['Agent.OS'], 'Linux' )) - # This represents the minimum Rust version supported. - # Tests are not run as tests may require newer versions of rust. - - job: msrv - pool: - vmImage: ubuntu-latest - displayName: "Minimum supported Rust version: 1.46.0" - dependsOn: [] - steps: - - template: install-rust.yml@templates - parameters: - rust: 1.46.0 # bitflags requires 1.46+ - - script: cargo check - displayName: cargo check - - job: integration - displayName: cargo test --tests - pool: - vmImage: ubuntu-latest - services: - greenmail: greenmail - steps: - - template: install-rust.yml@templates - - script: cargo test --tests - displayName: cargo test - - template: coverage.yml@templates - parameters: - token: $(CODECOV_TOKEN_SECRET) - services: - greenmail: greenmail - env: - TEST_HOST: greenmail - - job: features - displayName: "Check feature combinations" - pool: - vmImage: ubuntu-latest - steps: - - template: install-rust.yml@templates - parameters: - rust: stable - - script: cargo install cargo-hack - displayName: install cargo-hack - - script: cargo hack --feature-powerset check --all-targets - displayName: cargo hack - -resources: - repositories: - - repository: templates - type: github - name: crate-ci/azure-pipelines - ref: refs/heads/v0.4 - endpoint: jonhoo - containers: - - container: greenmail - image: greenmail/standalone:1.6.3 - ports: - - 3025:3025 - - 3110:3110 - - 3143:3143 - - 3465:3465 - - 3993:3993 - - 3995:3995 - env: - GREENMAIL_OPTS: "-Dgreenmail.setup.test.all -Dgreenmail.hostname=0.0.0.0 -Dgreenmail.auth.disabled -Dgreenmail.verbose"