Skip to content

Commit

Permalink
feat(ci): add check workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
TD-Sky committed Dec 21, 2024
1 parent 8cf4032 commit 3689157
Showing 4 changed files with 57 additions and 14 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -2,8 +2,6 @@ name: Build

on:
push:
branches:
- main
tags:
- "v[0-9]+.[0-9]+.[0-9]+"

41 changes: 41 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Check

on:
push:
branches:
- main
pull_request:
branches:
- main

env:
CARGO_TERM_COLOR: always

jobs:
clippy:
strategy:
matrix:
include:
- os: ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable

- name: Cache ~/.cargo and target
uses: Swatinem/rust-cache@v2

- name: Clippy
run: cargo clippy --all-features --all-targets -- -D warnings

rustfmt:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable

- name: Rustfmt
run: cargo fmt --check
23 changes: 13 additions & 10 deletions src/bin/conceal/main.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
mod cli;

use std::process;

use clap::Parser;
use conceal::handler;

use self::cli::{Cli, SubCommand};
use cli::Cli;

#[cfg(freedesktop)]
fn main() {
#[allow(unused_variables)]
let cli = Cli::parse();
use std::process;

#[cfg(target_os = "macos")]
{
return;
}
use conceal::handler;

use cli::SubCommand;

let cli = Cli::parse();

use SubCommand::*;
let result = match cli.command {
@@ -28,3 +26,8 @@ fn main() {
process::exit(1);
}
}

#[cfg(not(freedesktop))]
fn main() {
Cli::parse();
}
5 changes: 3 additions & 2 deletions src/handler/mod.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#[cfg(freedesktop)]
mod clean;
#[cfg(freedesktop)]
mod list;
mod put;
#[cfg(freedesktop)]
mod restore;

pub use self::put::put;
#[cfg(freedesktop)]
pub use self::{clean::clean, restore::restore};
pub use self::{list::list, put::put};
pub use self::{clean::clean, list::list, restore::restore};

0 comments on commit 3689157

Please sign in to comment.