update github workflows

This commit is contained in:
MedzikUser 2022-01-22 23:02:05 +01:00
parent 4145e7e86b
commit b8ba315654
No known key found for this signature in database
GPG Key ID: A5FAC1E185C112DB
6 changed files with 66 additions and 24 deletions

View File

@ -10,3 +10,11 @@ end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = false
[*.yml]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = false

41
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,41 @@
name: Rust
on:
push:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
rust: [stable, nightly]
name: ${{ matrix.rust }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
components: rustfmt, clippy
- name: cargo build
uses: actions-rs/cargo@v1
with:
command: build
- name: cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings

View File

@ -19,10 +19,21 @@ jobs:
git config --global user.name "MedzikUserBot"
git config --global user.email "rm99iv9s@duck.com"
- name: Lint
run: cargo fmt
- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- name: Push changes
- name: cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all
- name: Commit changes
run: |
git add .
git diff-index --quiet HEAD || git commit -m "rustfmt"

17
Cargo.lock generated
View File

@ -2,12 +2,6 @@
# It is not intended for manual editing.
version = 3
[[package]]
name = "anyhow"
version = "1.0.53"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94a45b455c14666b85fc40a019e8ab9eb75e3a124e05494f5397122bc9eb06e0"
[[package]]
name = "atty"
version = "0.2.14"
@ -377,7 +371,6 @@ dependencies = [
name = "imgurs"
version = "0.1.0"
dependencies = [
"anyhow",
"base64",
"chrono",
"clap",
@ -387,7 +380,6 @@ dependencies = [
"serde",
"serde_derive",
"serde_json",
"shadow",
"simple_logger",
"tokio",
"toml",
@ -853,15 +845,6 @@ dependencies = [
"serde",
]
[[package]]
name = "shadow"
version = "0.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dcaa1dbf13cc052b53af59e70dd467e8e94d6abf8d0eac1f1d15d3e165973b86"
dependencies = [
"libc",
]
[[package]]
name = "signal-hook-registry"
version = "1.4.0"

View File

@ -7,11 +7,10 @@ edition = "2021"
dirs = "4.0.0"
serde = "1.0.134"
serde_derive = "1.0.134"
shadow = "0.0.1"
toml = "0.5.8"
serde_json = "1.0.75"
chrono = "0.4.19"
anyhow = "1.0.53"
#anyhow = "1.0.53"
base64 = "0.13.0"
[dependencies.clap]

View File

@ -24,8 +24,8 @@ impl ImgurHandle {
pub fn new(client_id: String) -> Self {
let client = Client::new();
ImgurHandle {
client_id: client_id,
client: client,
client_id,
client,
}
}
}