Merge pull request #242 from jonhoo/ci

Sync with rust-ci-conf
This commit is contained in:
Jon Gjengset 2022-09-18 16:00:33 -04:00 committed by GitHub
commit 3a6540752c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 1474 additions and 226 deletions

107
.github/workflows/check.yml vendored Normal file
View file

@ -0,0 +1,107 @@
on:
push:
branches: [main]
pull_request:
name: check
jobs:
fmt:
runs-on: ubuntu-latest
name: stable / fmt
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: rustfmt
- name: cargo fmt --check
uses: actions-rs/cargo@v1
with:
command: fmt
args: --check
clippy:
runs-on: ubuntu-latest
name: ${{ matrix.toolchain }} / clippy
strategy:
fail-fast: false
matrix:
toolchain: [stable, beta]
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install ${{ matrix.toolchain }}
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
default: true
components: clippy
- name: cargo clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
doc:
runs-on: ubuntu-latest
name: nightly / doc
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install nightly
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
default: true
- name: cargo doc
uses: actions-rs/cargo@v1
with:
command: doc
args: --no-deps --all-features
env:
RUSTDOCFLAGS: --cfg docsrs
hack:
runs-on: ubuntu-latest
name: ubuntu / stable / features
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: cargo install cargo-hack
uses: taiki-e/install-action@cargo-hack
- name: cargo hack
uses: actions-rs/cargo@v1
with:
command: hack
args: --feature-powerset check --all-targets
msrv:
runs-on: ubuntu-latest
# we use a matrix here just because env can't be used in job names
# https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability
strategy:
matrix:
msrv: [1.56.1] # 2021 edition requires 1.56
name: ubuntu / ${{ matrix.msrv }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install ${{ matrix.toolchain }}
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.msrv }}
default: true
- name: cargo +${{ matrix.msrv }} check
uses: actions-rs/cargo@v1
with:
command: check

View file

@ -1,34 +0,0 @@
on:
push:
branches: [main]
pull_request:
name: coverage
jobs:
test:
runs-on: ubuntu-latest
steps:
- 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 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:
cyrus_imapd:
image: outoforder/cyrus-imapd-tester:latest
ports:
- 3025:25
- 3143:143
- 3465:465
- 3993:993

View file

@ -1,23 +0,0 @@
on:
push:
branches: [main]
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@v3
with:
submodules: true
- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack
- name: cargo hack
uses: actions-rs/cargo@v1
with:
command: hack
args: --feature-powerset check --all-targets

View file

@ -1,39 +0,0 @@
on:
push:
branches: [main]
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@v3
with:
submodules: true
- 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
args: --features test-full-imap --all-targets
services:
cyrus_imapd:
image: outoforder/cyrus-imapd-tester:latest
ports:
- 3025:25
- 3143:143
- 3465:465
- 3993:993

View file

@ -1,21 +0,0 @@
on:
push:
branches: [main]
pull_request:
name: Minimum Supported Rust Version
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.56.1 # 2021 edition requires 1.56
override: true
- uses: actions/checkout@v3
with:
submodules: true
- name: cargo +1.56.1 check
uses: actions-rs/cargo@v1
with:
command: check

View file

@ -1,24 +0,0 @@
on:
push:
branches: [main]
pull_request:
name: os 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@v3
- name: cargo check
uses: actions-rs/cargo@v1
with:
command: check
args: --all-features --all-targets

80
.github/workflows/scheduled.yml vendored Normal file
View file

@ -0,0 +1,80 @@
on:
push:
branches: [main]
pull_request:
schedule:
- cron: '7 7 * * *'
name: cargo test (rolling)
jobs:
# https://twitter.com/mycoliza/status/1571295690063753218
nightly:
runs-on: ubuntu-latest
name: ubuntu / nightly
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install nightly
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
default: true
- name: cargo generate-lockfile
if: hashFiles('Cargo.lock') == ''
uses: actions-rs/cargo@v1
with:
command: generate-lockfile
- name: cargo test --locked
uses: actions-rs/cargo@v1
with:
command: test
args: --locked --features test-full-imap --all-targets
services:
cyrus_imapd:
image: outoforder/cyrus-imapd-tester:latest
ports:
- 3025:25
- 3143:143
- 3465:465
- 3993:993
# https://twitter.com/alcuadrado/status/1571291687837732873
update:
runs-on: ubuntu-latest
name: ubuntu / beta / updated
# There's no point running this if no Cargo.lock was checked in in the
# first place, since we'd just redo what happened in the regular test job.
# Unfortunately, hashFiles only works in if on steps, so we reepeat it.
# if: hashFiles('Cargo.lock') != ''
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install beta
if: hashFiles('Cargo.lock') != ''
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: beta
default: true
- name: cargo update
if: hashFiles('Cargo.lock') != ''
uses: actions-rs/cargo@v1
with:
command: update
- name: cargo test
if: hashFiles('Cargo.lock') != ''
uses: actions-rs/cargo@v1
with:
command: test
args: --locked --features test-full-imap --all-targets
env:
RUSTFLAGS: -D deprecated
services:
cyrus_imapd:
image: outoforder/cyrus-imapd-tester:latest
ports:
- 3025:25
- 3143:143
- 3465:465
- 3993:993

View file

@ -1,48 +0,0 @@
on:
push:
branches: [main]
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@v3
with:
submodules: true
- name: cargo fmt --check
uses: actions-rs/cargo@v1
with:
command: fmt
args: --check
- 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

@ -2,27 +2,35 @@ on:
push:
branches: [main]
pull_request:
name: cargo test
name: test
jobs:
test:
greenmail:
runs-on: ubuntu-latest
name: greenmail/${{ matrix.toolchain }}
name: ubuntu / ${{ matrix.toolchain }} / greenmail
strategy:
matrix:
toolchain: [stable, beta, nightly]
toolchain: [stable, beta]
steps:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
- uses: actions/checkout@v3
with:
submodules: true
- name: cargo test
- name: Install ${{ matrix.toolchain }}
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
default: true
- name: cargo generate-lockfile
if: hashFiles('Cargo.lock') == ''
uses: actions-rs/cargo@v1
with:
command: generate-lockfile
# https://twitter.com/jonhoo/status/1571290371124260865
- name: cargo test --locked
uses: actions-rs/cargo@v1
with:
command: test
args: --all-targets
args: --locked --all-targets
services:
greenmail:
image: greenmail/standalone:1.6.8
@ -35,25 +43,129 @@ jobs:
- 3995:3995
env:
GREENMAIL_OPTS: "-Dgreenmail.setup.test.all -Dgreenmail.hostname=0.0.0.0 -Dgreenmail.auth.disabled -Dgreenmail.verbose"
test_cyrus:
cyrus:
runs-on: ubuntu-latest
name: cyrus/${{ matrix.toolchain }}
name: ubuntu / ${{ matrix.toolchain }} / cyrus
strategy:
matrix:
toolchain: [stable, beta, nightly]
toolchain: [stable, beta]
steps:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
- uses: actions/checkout@v3
with:
submodules: true
- name: cargo test
- name: Install ${{ matrix.toolchain }}
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
default: true
- name: cargo generate-lockfile
if: hashFiles('Cargo.lock') == ''
uses: actions-rs/cargo@v1
with:
command: generate-lockfile
# https://twitter.com/jonhoo/status/1571290371124260865
- name: cargo test --locked
uses: actions-rs/cargo@v1
with:
command: test
args: --features test-full-imap --all-targets
args: --locked --features test-full-imap --all-targets
services:
cyrus_imapd:
image: outoforder/cyrus-imapd-tester:latest
ports:
- 3025:25
- 3143:143
- 3465:465
- 3993:993
minimal:
runs-on: ubuntu-latest
name: ubuntu / stable / minimal-versions
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: Install nightly for -Zminimal-versions
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
- 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
args: --locked --features test-full-imap --all-targets
services:
cyrus_imapd:
image: outoforder/cyrus-imapd-tester:latest
ports:
- 3025:25
- 3143:143
- 3465:465
- 3993:993
os-check:
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} / stable
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest]
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: cargo generate-lockfile
if: hashFiles('Cargo.lock') == ''
uses: actions-rs/cargo@v1
with:
command: generate-lockfile
- name: cargo check
uses: actions-rs/cargo@v1
with:
command: check
args: --locked --all-features --all-targets
coverage:
runs-on: ubuntu-latest
name: ubuntu / stable / coverage
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: llvm-tools-preview
- name: cargo install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: cargo generate-lockfile
if: hashFiles('Cargo.lock') == ''
uses: actions-rs/cargo@v1
with:
command: generate-lockfile
- name: cargo llvm-cov
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:
cyrus_imapd:
image: outoforder/cyrus-imapd-tester:latest

1
.gitignore vendored
View file

@ -1,2 +1 @@
target
Cargo.lock

1156
Cargo.lock generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,17 +0,0 @@
coverage:
range: 70..100
round: down
precision: 2
status:
project:
default:
threshold: 2%
# Tests aren't important for coverage
ignore:
- "tests"
# Make less noisy comments
comment:
layout: "files"
require_changes: yes