name: CI on: pull_request: push: branches: - master env: RUST_BACKTRACE: full jobs: rustfmt: name: rustfmt / stable runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 - name: Install rust run: | rustup update --no-self-update stable rustup component add rustfmt - name: cargo fmt run: cargo fmt --all -- --check clippy: name: clippy / stable runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 - name: Install rust run: | rustup update --no-self-update stable rustup component add clippy - name: Run clippy run: cargo clippy --all-features --all-targets -- -D warnings check: name: check / stable runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 - name: Setup cache uses: actions/cache@v2 with: path: | ~/.cargo/registry ~/.cargo/git target key: ${{ runner.os }}-cargo-check - name: Install rust run: rustup update --no-self-update stable - name: Install cargo hack run: cargo install cargo-hack --debug - name: Check with cargo hack run: cargo hack check --feature-powerset --depth 3 test: name: test / ${{ matrix.name }} runs-on: ubuntu-latest strategy: matrix: include: - name: stable rust: stable - name: beta rust: beta - name: 1.45.2 rust: 1.45.2 steps: - name: Checkout uses: actions/checkout@v2 - name: Setup cache uses: actions/cache@v2 with: path: | ~/.cargo/registry ~/.cargo/git target key: ${{ runner.os }}-cargo-test-${{ matrix.rust }} - name: Install rust run: | rustup default ${{ matrix.rust }} rustup update --no-self-update ${{ matrix.rust }} - name: Install postfix run: | DEBIAN_FRONTEND=noninteractive sudo apt-get update DEBIAN_FRONTEND=noninteractive sudo apt-get -y install postfix - name: Run SMTP server run: smtp-sink 2525 1000& - name: Test with no default features run: cargo test --no-default-features - name: Test with default features run: cargo test - name: Test with all features run: cargo test --all-features # coverage: # name: Coverage # runs-on: ubuntu-latest # steps: # - uses: actions/checkout@v2 # - uses: actions-rs/toolchain@v1 # with: # toolchain: nightly # override: true # - run: sudo DEBIAN_FRONTEND=noninteractive apt-get -y install postfix # - run: smtp-sink 2525 1000& # - uses: actions-rs/cargo@v1 # with: # command: test # args: --no-fail-fast # env: # CARGO_INCREMENTAL: "0" # RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zno-landing-pads" # - id: coverage # uses: actions-rs/grcov@v0.1 # - name: Coveralls upload # uses: coverallsapp/github-action@master # with: # github-token: ${{ secrets.GITHUB_TOKEN }} # path-to-lcov: ${{ steps.coverage.outputs.report }}