Skip to content

Commit

Permalink
ci: Port CI to just
Browse files Browse the repository at this point in the history
  • Loading branch information
duesee committed Apr 19, 2024
1 parent 3ff462d commit 73f6834
Show file tree
Hide file tree
Showing 10 changed files with 288 additions and 126 deletions.
34 changes: 0 additions & 34 deletions .github/workflows/api.yml

This file was deleted.

50 changes: 46 additions & 4 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,57 @@
name: Audit

on:
push:
branches: [ main ]
paths:
- "**.rs"
- "**.toml"
- ".github/workflows/**"
pull_request:
branches: [ main ]
paths:
- "**.rs"
- "**.toml"
- ".github/workflows/**"
schedule:
# 21:43 on Wednesday and Sunday. (Thanks, crontab.guru)
- cron: "43 21 * * 3,0"
- cron: '43 21 * * 3,0'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
audit:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@1e59595bed8fc55c969333d08d7817b36888f0c5

- id: cache-restore
uses: actions/cache/restore@v4
with:
# See https://doc.rust-lang.org/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci
path: |
~/.cargo/.crates.toml
~/.cargo/.crates2.json
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ github.workflow }}

- run: cargo install just
- run: just audit

- id: cache-save
uses: actions/cache/save@v4
with:
# See https://doc.rust-lang.org/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci
path: |
~/.cargo/.crates.toml
~/.cargo/.crates2.json
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ steps.cache-restore.outputs.cache-primary-key }}
37 changes: 0 additions & 37 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,43 +91,6 @@ jobs:
if: matrix.os == 'ubuntu-latest'
run: echo "NOOP" # TODO

minimal-versions:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup | Install toolchain
run: |
# 1.66 is the Minimum Supported Rust Version (MSRV) for imap-flow.
rustup toolchain install 1.66 --profile minimal
rustup toolchain install nightly --profile minimal
- name: Setup | Cache dependencies
uses: Swatinem/[email protected]
id: cache
with:
cache-all-crates: true

- name: Check
run: |
cargo +nightly update -Z minimal-versions
cargo +1.66 check --workspace --all-targets --all-features
cargo +1.66 test --workspace --all-targets --all-features # TODO: exclude fuzz-targets
env:
RUSTFLAGS: -Dwarnings

audit:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Audit dependencies
uses: EmbarkStudios/cargo-deny-action@1e59595bed8fc55c969333d08d7817b36888f0c5

clippy:
runs-on: ubuntu-latest

Expand Down
70 changes: 38 additions & 32 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
name: Measure test coverage

on:
push:
branches: [main]
branches: [ main ]
paths:
- "**.rs"
- "**.toml"
- ".github/workflows/**"
- '**.rs'
- '**.toml'
- '.github/workflows/**'
pull_request:
branches: [main]
branches: [ main ]
paths:
- "**.rs"
- "**.toml"
- ".github/workflows/**"
- '**.rs'
- '**.toml'
- '.github/workflows/**'
workflow_dispatch:

concurrency:
Expand All @@ -24,30 +22,38 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Setup
run: |
rustup component add llvm-tools-preview
cargo install grcov
- uses: actions/checkout@v4

- id: cache-restore
uses: actions/cache/restore@v4
with:
# See https://doc.rust-lang.org/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci
path: |
~/.cargo/.crates.toml
~/.cargo/.crates2.json
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ github.workflow }}

- name: Checkout code
uses: actions/checkout@v4
- run: cargo install just
- run: just coverage

- name: Measure test coverage
env:
RUSTFLAGS: "-Cinstrument-coverage"
LLVM_PROFILE_FILE: "coverage-%m-%p.profraw"
run: |
cargo test --all-features
grcov . \
--source-dir . \
--binary-path target/debug \
--branch \
--keep-only 'src/**' \
--output-types "lcov" \
--llvm > coveralls.lcov
- id: cache-save
uses: actions/cache/save@v4
with:
# See https://doc.rust-lang.org/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci
path: |
~/.cargo/.crates.toml
~/.cargo/.crates2.json
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ steps.cache-restore.outputs.cache-primary-key }}

- name: Upload to Coveralls
uses: coverallsapp/github-action@v2
- uses: coverallsapp/github-action@c203f016dd0ff7855ebef0ed852000c20c117148
with:
format: lcov
file: coveralls.lcov
file: target/coverage/coverage.lcov
55 changes: 55 additions & 0 deletions .github/workflows/minimal_versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
on:
push:
branches: [ main ]
paths:
- "**.rs"
- "**.toml"
- ".github/workflows/**"
pull_request:
branches: [ main ]
paths:
- "**.rs"
- "**.toml"
- ".github/workflows/**"
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
minimal_versions:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- id: cache-restore
uses: actions/cache/restore@v4
with:
# See https://doc.rust-lang.org/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci
path: |
~/.cargo/.crates.toml
~/.cargo/.crates2.json
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ github.workflow }}

- run: cargo install just
- run: just minimal_versions

- id: cache-save
uses: actions/cache/save@v4
with:
# See https://doc.rust-lang.org/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci
path: |
~/.cargo/.crates.toml
~/.cargo/.crates2.json
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ steps.cache-restore.outputs.cache-primary-key }}

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ expose_stream = []

[dependencies]
bounded-static = "0.5.0"
bytes = "1.5.0"
bytes = "1.6.0"
imap-codec = { version = "2.0.0", features = ["quirk_crlf_relaxed", "bounded-static"] }
imap-types = { version = "2.0.0" }
thiserror = "1.0.49"
tokio = { version = "1.32.0", features = ["io-util"] }
thiserror = "1.0.58"
tokio = { version = "1.37.0", features = ["io-util"] }
tracing = "0.1.40"

[dev-dependencies]
rand = "0.8.5"
tag-generator = { path = "tag-generator" }
tokio = { version = "1.32.0", features = ["macros", "net", "rt", "sync"] }
tokio = { version = "1.37.0", features = ["macros", "net", "rt", "sync"] }

[workspace]
resolver = "2"
Expand Down
13 changes: 8 additions & 5 deletions flow-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ edition = "2021"
license = "MIT OR Apache-2.0"

[dependencies]
bstr = { version = "1.9.0", default-features = false }
bytes = "1.5.0"
bstr = { version = "1.9.1", default-features = false }
bytes = "1.6.0"
imap-codec = "2.0.0"
imap-flow = { path = ".." }
imap-types = "2.0.0"
tokio = { version = "1.32.0", features = ["macros", "net", "rt", "time"] }
tracing = "0.1.37"
tracing-subscriber = { version = "0.3.17", features = ["env-filter"] }
tokio = { version = "1.37.0", features = ["macros", "net", "rt", "time"] }
tracing = "0.1.40"
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }

# Fix minimal versions
lazy_static = "1.4.0"
Loading

0 comments on commit 73f6834

Please sign in to comment.