From 96f5e4e0634dcf3f51c0ffac29a498c87eff6400 Mon Sep 17 00:00:00 2001 From: Johannes Heuel Date: Wed, 14 Feb 2024 15:53:14 +0100 Subject: [PATCH] add CI --- .drone.yml | 18 ++++++++++++++++++ .pre-commit-config.yaml | 13 +++++++++++++ Cargo.toml | 2 +- src/main.rs | 2 +- 4 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 .drone.yml create mode 100644 .pre-commit-config.yaml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..7d47cb9 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,18 @@ +kind: pipeline +type: docker +name: default + +steps: + - name: pre-commit + image: iamthefij/drone-pre-commit:latest + commands: + - apt-get update && apt-get install -y cmake + - curl https://sh.rustup.rs -sSf | bash -s -- -y + - export PATH="/root/.cargo/bin:$${PATH}" + - pre-commit run --all-files + - name: test + image: rust:latest + commands: + - apt-get update && apt-get install -y cmake + - cargo build --verbose --all + - cargo test --verbose --all diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..c0225d5 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,13 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.3.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-added-large-files +- repo: https://github.com/doublify/pre-commit-rust + rev: v1.0 + hooks: + - id: fmt + - id: cargo-check diff --git a/Cargo.toml b/Cargo.toml index ce0a072..b418258 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,4 +19,4 @@ twilight-http = "0.15" twilight-model = "0.15" twilight-standby = "0.15" twilight-cache-inmemory = "0.15" -dotenv = "0.15.0" \ No newline at end of file +dotenv = "0.15.0" diff --git a/src/main.rs b/src/main.rs index 3057792..aec61f5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -192,7 +192,7 @@ async fn play(msg: Message, state: State) -> Result<(), Box".to_string()),