Skip to content

Commit

Permalink
ci: run cargo format --check
Browse files Browse the repository at this point in the history
  • Loading branch information
hugocaillard committed Oct 3, 2024
1 parent feb7429 commit 29c74f4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@ concurrency:
cancel-in-progress: true

jobs:
format:
name: Format check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Rust toolchain
run: rustup toolchain install stable --profile minimal --component rustfmt

- name: Run rustfmt
run: cargo fmt --all -- --check

build:
runs-on: ubuntu-latest
outputs:
Expand Down
6 changes: 1 addition & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@ async fn main() {
let config_path = match env::var("CONFIG_PATH") {
Ok(path) => path,
Err(_) => {
if cfg!(debug_assertions) {
"./Config.toml".into()
} else {
"/etc/config/Config.toml".into()
}
if cfg!(debug_assertions) { "./Config.toml".into() } else { "/etc/config/Config.toml".into() }
}
};
let config = ApiConfig::from_path(&config_path);
Expand Down

0 comments on commit 29c74f4

Please sign in to comment.