diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..2eb8678 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,41 @@ +name: CI + +on: + pull_request: + push: + branches: [main] + +env: + CARGO_TERM_COLOR: always + +jobs: + format: + name: Format + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@nightly + with: + components: "rustfmt" + - run: cargo +nightly fmt --all --check + + clippy: + name: Clippy + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + - run: cargo clippy --all --all-targets + + test: + name: Test + runs-on: ubuntu-latest + timeout-minutes: 45 + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + - run: cargo test --all --all-features diff --git a/ctl/Cargo.toml b/ctl/Cargo.toml index f862712..1011561 100644 --- a/ctl/Cargo.toml +++ b/ctl/Cargo.toml @@ -2,6 +2,8 @@ name = "ctl" version.workspace = true edition.workspace = true -lints.workspace = true + +[lints] +workspace = true [dependencies] diff --git a/rustfmt.toml b/rustfmt.toml index f34a9f3..6fd403b 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -2,5 +2,6 @@ imports_granularity = "Crate" newline_style = "Unix" # Unstable options +group_imports = "StdExternalCrate" wrap_comments = true comment_width = 80 diff --git a/worker/Cargo.toml b/worker/Cargo.toml index ba93e55..698f95d 100644 --- a/worker/Cargo.toml +++ b/worker/Cargo.toml @@ -2,6 +2,8 @@ name = "worker" version.workspace = true edition.workspace = true -lints.workspace = true + +[lints] +workspace = true [dependencies]