add CI
This commit is contained in:
18
.drone.yml
Normal file
18
.drone.yml
Normal file
@@ -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
|
||||
13
.pre-commit-config.yaml
Normal file
13
.pre-commit-config.yaml
Normal file
@@ -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
|
||||
@@ -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"
|
||||
dotenv = "0.15.0"
|
||||
|
||||
@@ -192,7 +192,7 @@ async fn play(msg: Message, state: State) -> Result<(), Box<dyn Error + Send + S
|
||||
let mut src = YoutubeDl::new(reqwest::Client::new(), url);
|
||||
if let Ok(metadata) = src.aux_metadata().await {
|
||||
info!("metadata: {:?}", metadata);
|
||||
|
||||
|
||||
let content = format!(
|
||||
"Playing **{:?}** by **{:?}**",
|
||||
metadata.title.as_ref().unwrap_or(&"<UNKNOWN>".to_string()),
|
||||
|
||||
Reference in New Issue
Block a user