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: on:
push: push:
branches: [master] branches: [main]
pull_request: pull_request:
name: coverage name: coverage
jobs: jobs:
test: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container:
image: xd009642/tarpaulin
options: --security-opt seccomp=unconfined
steps: 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 - name: Generate code coverage
run: | run: cargo llvm-cov --features test-full-imap --lcov --output-path lcov.info
cargo tarpaulin --verbose --timeout 120 --out Xml
env:
TEST_HOST: greenmail
- name: Upload to codecov.io - name: Upload to codecov.io
uses: codecov/codecov-action@v2 uses: codecov/codecov-action@v2
with: with:
fail_ci_if_error: true fail_ci_if_error: true
services: services:
greenmail: cyrus_imapd:
image: greenmail/standalone:1.6.8 image: outoforder/cyrus-imapd-tester:latest
ports: ports:
- 3025:3025 - 3025:25
- 3110:3110 - 3143:143
- 3143:3143 - 3465:465
- 3465:3465 - 3993:993
- 3993:3993
- 3995:3995
env:
GREENMAIL_OPTS: "-Dgreenmail.setup.test.all -Dgreenmail.hostname=0.0.0.0 -Dgreenmail.auth.disabled -Dgreenmail.verbose"

View file

@ -1,6 +1,6 @@
on: on:
push: push:
branches: [master] branches: [main]
pull_request: pull_request:
name: cargo hack name: cargo hack
jobs: jobs:
@ -11,13 +11,11 @@ jobs:
with: with:
profile: minimal profile: minimal
toolchain: stable toolchain: stable
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: Install cargo-hack
uses: actions-rs/install@v0.1
with: with:
crate: cargo-hack submodules: true
version: latest - name: Install cargo-hack
use-tool-cache: true uses: taiki-e/install-action@cargo-hack
- name: cargo hack - name: cargo hack
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
with: with:

View file

@ -1,6 +1,6 @@
on: on:
push: push:
branches: [master] branches: [main]
pull_request: pull_request:
name: With dependencies at minimal versions name: With dependencies at minimal versions
jobs: jobs:
@ -15,7 +15,9 @@ jobs:
with: with:
profile: minimal profile: minimal
toolchain: stable toolchain: stable
- uses: actions/checkout@v2 - uses: actions/checkout@v3
with:
submodules: true
- name: cargo update -Zminimal-versions - name: cargo update -Zminimal-versions
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
with: with:
@ -26,15 +28,12 @@ jobs:
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
with: with:
command: test command: test
args: --features test-full-imap --all-targets
services: services:
greenmail: cyrus_imapd:
image: greenmail/standalone:1.6.8 image: outoforder/cyrus-imapd-tester:latest
ports: ports:
- 3025:3025 - 3025:25
- 3110:3110 - 3143:143
- 3143:3143 - 3465:465
- 3465:3465 - 3993:993
- 3993:3993
- 3995:3995
env:
GREENMAIL_OPTS: "-Dgreenmail.setup.test.all -Dgreenmail.hostname=0.0.0.0 -Dgreenmail.auth.disabled -Dgreenmail.verbose"

View file

@ -1,6 +1,6 @@
on: on:
push: push:
branches: [master] branches: [main]
pull_request: pull_request:
name: Minimum Supported Rust Version name: Minimum Supported Rust Version
jobs: jobs:
@ -10,10 +10,12 @@ jobs:
- uses: actions-rs/toolchain@v1 - uses: actions-rs/toolchain@v1
with: with:
profile: minimal profile: minimal
toolchain: 1.56.0 # 2021 edition requires 1.56 toolchain: 1.56.1 # 2021 edition requires 1.56
override: true override: true
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: cargo +1.56.0 check with:
submodules: true
- name: cargo +1.56.1 check
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
with: with:
command: check command: check

View file

@ -1,8 +1,8 @@
on: on:
push: push:
branches: [master] branches: [main]
pull_request: pull_request:
name: cargo check name: os check
jobs: jobs:
os-check: os-check:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@ -16,7 +16,7 @@ jobs:
with: with:
profile: minimal profile: minimal
toolchain: stable toolchain: stable
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: cargo check - name: cargo check
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
with: with:

View file

@ -1,6 +1,6 @@
on: on:
push: push:
branches: [master] branches: [main]
pull_request: pull_request:
name: lint name: lint
jobs: jobs:
@ -17,20 +17,32 @@ jobs:
profile: minimal profile: minimal
toolchain: ${{ matrix.toolchain }} toolchain: ${{ matrix.toolchain }}
components: rustfmt, clippy components: rustfmt, clippy
- uses: actions/checkout@v2 - uses: actions/checkout@v3
with:
submodules: true
- name: cargo fmt --check - name: cargo fmt --check
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
with: with:
command: fmt command: fmt
args: --check args: --check
- name: cargo doc
uses: actions-rs/cargo@v1
if: always()
with:
command: doc
args: --no-deps --all-features
- name: cargo clippy - name: cargo clippy
uses: actions-rs/clippy-check@v1 uses: actions-rs/clippy-check@v1
if: always() if: always()
with: with:
token: ${{ secrets.GITHUB_TOKEN }} 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: on:
push: push:
branches: [master] branches: [main]
pull_request: pull_request:
name: cargo test name: cargo test
jobs: jobs:
@ -15,11 +15,14 @@ jobs:
with: with:
profile: minimal profile: minimal
toolchain: ${{ matrix.toolchain }} toolchain: ${{ matrix.toolchain }}
- uses: actions/checkout@v2 - uses: actions/checkout@v3
with:
submodules: true
- name: cargo test - name: cargo test
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
with: with:
command: test command: test
args: --all-targets
services: services:
greenmail: greenmail:
image: greenmail/standalone:1.6.8 image: greenmail/standalone:1.6.8
@ -43,12 +46,14 @@ jobs:
with: with:
profile: minimal profile: minimal
toolchain: ${{ matrix.toolchain }} toolchain: ${{ matrix.toolchain }}
- uses: actions/checkout@v2 - uses: actions/checkout@v3
with:
submodules: true
- name: cargo test - name: cargo test
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
with: with:
command: test command: test
args: --features test-full-imap args: --features test-full-imap --all-targets
services: services:
cyrus_imapd: cyrus_imapd:
image: outoforder/cyrus-imapd-tester:latest image: outoforder/cyrus-imapd-tester:latest

View file

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