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 1dd9488
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,20 @@ concurrency:
cancel-in-progress: true

jobs:
audit:
name: Format check
runs-on: ubuntu-latest
needs: pre_run
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 1dd9488

Please sign in to comment.