diff --git a/.github/codecov.yml b/.github/codecov.yml new file mode 100644 index 0000000..ff4f571 --- /dev/null +++ b/.github/codecov.yml @@ -0,0 +1,21 @@ +# ref: https://docs.codecov.com/docs/codecovyml-reference +coverage: + # Hold ourselves to a high bar + range: 85..100 + round: down + precision: 1 + status: + # ref: https://docs.codecov.com/docs/commit-status + project: + default: + # Avoid false negatives + threshold: 1% + +# Test files aren't important for coverage +ignore: + - "tests" + +# Make comments less noisy +comment: + layout: "files" + require_changes: yes diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index b38f6e1..e9a9358 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -1,34 +1,34 @@ on: push: - branches: [master] + branches: [main] pull_request: name: coverage jobs: test: runs-on: ubuntu-latest - container: - image: xd009642/tarpaulin - options: --security-opt seccomp=unconfined steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + with: + submodules: true + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + components: llvm-tools-preview + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov - name: Generate code coverage - run: | - cargo tarpaulin --verbose --timeout 120 --out Xml - env: - TEST_HOST: greenmail + run: cargo llvm-cov --features test-full-imap --lcov --output-path lcov.info - name: Upload to codecov.io uses: codecov/codecov-action@v2 with: fail_ci_if_error: true services: - greenmail: - image: greenmail/standalone:1.6.8 + cyrus_imapd: + image: outoforder/cyrus-imapd-tester:latest 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" + - 3025:25 + - 3143:143 + - 3465:465 + - 3993:993 diff --git a/.github/workflows/features.yml b/.github/workflows/features.yml index dd787cb..ac5e18e 100644 --- a/.github/workflows/features.yml +++ b/.github/workflows/features.yml @@ -1,6 +1,6 @@ on: push: - branches: [master] + branches: [main] pull_request: name: cargo hack jobs: @@ -11,13 +11,11 @@ jobs: with: profile: minimal toolchain: stable - - uses: actions/checkout@v2 - - name: Install cargo-hack - uses: actions-rs/install@v0.1 + - uses: actions/checkout@v3 with: - crate: cargo-hack - version: latest - use-tool-cache: true + submodules: true + - name: Install cargo-hack + uses: taiki-e/install-action@cargo-hack - name: cargo hack uses: actions-rs/cargo@v1 with: diff --git a/.github/workflows/minimal.yml b/.github/workflows/minimal.yml index 4ea4722..9a3f187 100644 --- a/.github/workflows/minimal.yml +++ b/.github/workflows/minimal.yml @@ -1,6 +1,6 @@ on: push: - branches: [master] + branches: [main] pull_request: name: With dependencies at minimal versions jobs: @@ -15,7 +15,9 @@ jobs: with: profile: minimal toolchain: stable - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + with: + submodules: true - name: cargo update -Zminimal-versions uses: actions-rs/cargo@v1 with: @@ -26,15 +28,12 @@ jobs: uses: actions-rs/cargo@v1 with: command: test + args: --features test-full-imap --all-targets services: - greenmail: - image: greenmail/standalone:1.6.8 + cyrus_imapd: + image: outoforder/cyrus-imapd-tester:latest 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" + - 3025:25 + - 3143:143 + - 3465:465 + - 3993:993 diff --git a/.github/workflows/msrv.yml b/.github/workflows/msrv.yml index ee1b2bf..d6d9046 100644 --- a/.github/workflows/msrv.yml +++ b/.github/workflows/msrv.yml @@ -1,6 +1,6 @@ on: push: - branches: [master] + branches: [main] pull_request: name: Minimum Supported Rust Version jobs: @@ -10,10 +10,12 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: 1.56.0 # 2021 edition requires 1.56 + toolchain: 1.56.1 # 2021 edition requires 1.56 override: true - - uses: actions/checkout@v2 - - name: cargo +1.56.0 check + - uses: actions/checkout@v3 + with: + submodules: true + - name: cargo +1.56.1 check uses: actions-rs/cargo@v1 with: command: check diff --git a/.github/workflows/os-check.yml b/.github/workflows/os-check.yml index bbcb475..1054489 100644 --- a/.github/workflows/os-check.yml +++ b/.github/workflows/os-check.yml @@ -1,8 +1,8 @@ on: push: - branches: [master] + branches: [main] pull_request: -name: cargo check +name: os check jobs: os-check: runs-on: ${{ matrix.os }} @@ -16,7 +16,7 @@ jobs: with: profile: minimal toolchain: stable - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: cargo check uses: actions-rs/cargo@v1 with: diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 34c058e..7a583f2 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -1,6 +1,6 @@ on: push: - branches: [master] + branches: [main] pull_request: name: lint jobs: @@ -17,20 +17,32 @@ jobs: profile: minimal toolchain: ${{ matrix.toolchain }} components: rustfmt, clippy - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + with: + submodules: true - 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 }} + doc: + runs-on: ubuntu-latest + steps: + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + - uses: actions/checkout@v3 + - name: cargo doc + uses: actions-rs/cargo@v1 + with: + toolchain: nightly + command: doc + args: --no-deps --all-features + env: + RUSTDOCFLAGS: --cfg docsrs diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c96579b..3821afd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,6 @@ on: push: - branches: [master] + branches: [main] pull_request: name: cargo test jobs: @@ -15,11 +15,14 @@ jobs: with: profile: minimal toolchain: ${{ matrix.toolchain }} - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + with: + submodules: true - name: cargo test uses: actions-rs/cargo@v1 with: command: test + args: --all-targets services: greenmail: image: greenmail/standalone:1.6.8 @@ -43,12 +46,14 @@ jobs: with: profile: minimal toolchain: ${{ matrix.toolchain }} - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + with: + submodules: true - name: cargo test uses: actions-rs/cargo@v1 with: command: test - args: --features test-full-imap + args: --features test-full-imap --all-targets services: cyrus_imapd: image: outoforder/cyrus-imapd-tester:latest diff --git a/src/lib.rs b/src/lib.rs index 3860474..b9c19ba 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -75,6 +75,7 @@ //! for a working example. #![deny(missing_docs)] #![warn(rust_2018_idioms)] +#![cfg_attr(docsrs, feature(doc_cfg))] mod parse;