Merge pull request #241 from jonhoo/ci

Refresh CI scripts
This commit is contained in:
Jon Gjengset 2022-09-17 18:22:52 -04:00 committed by GitHub
commit 00e6eee93c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 95 additions and 57 deletions

21
.github/codecov.yml vendored Normal file
View file

@ -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

View file

@ -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

View file

@ -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:

View file

@ -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

View file

@ -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

View file

@ -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:

View file

@ -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

View file

@ -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

View file

@ -75,6 +75,7 @@
//! for a working example.
#![deny(missing_docs)]
#![warn(rust_2018_idioms)]
#![cfg_attr(docsrs, feature(doc_cfg))]
mod parse;