diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..2765865 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,49 @@ +name: CI +on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + push: + branches: + - 'master' +jobs: + build: + name: Build & Install + env: + CARGO_INCREMENTAL: 1 + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + target: x86_64-apple-darwin + override: true + - name: Cache Dependencies + uses: actions/cache@v2 + env: + cache-name: cache-dependencies + with: + path: | + ~/.cargo/.crates.toml + ~/.cargo/.crates2.json + ~/.cargo/bin + ~/.cargo/registry/index + ~/.cargo/registry/cache + target + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('Cargo.lock') }} + - name: Install + run: | + make install + # TODO(ci): test opening and closing xcodeproj in neovim and the resulting behavior + rustfmt: + name: Rustfmt + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + components: rustfmt + override: true + - run: cargo fmt -- --check diff --git a/daemon/src/main.rs b/daemon/src/main.rs index e546530..ff744cf 100644 --- a/daemon/src/main.rs +++ b/daemon/src/main.rs @@ -1,8 +1,8 @@ +use log::Level; use tap::Pipe; use tokio::fs::{metadata, read_to_string, remove_file, write}; use tokio::io::AsyncReadExt; use tokio::net::UnixListener; -use log::Level; use xbase_daemon::util::pid; use xbase_daemon::Result; use xbase_daemon::{constants::*, RequestHandler}; diff --git a/daemon/src/watch/mod.rs b/daemon/src/watch/mod.rs index ce60143..d9ea691 100644 --- a/daemon/src/watch/mod.rs +++ b/daemon/src/watch/mod.rs @@ -7,6 +7,7 @@ use crate::compile::ensure_server_support; use crate::error::EnsureOptional; use crate::{constants::DAEMON_STATE, state::State, Result}; use async_trait::async_trait; +use log::{debug, error, info, trace}; use notify::{Config, RecommendedWatcher, RecursiveMode::Recursive, Watcher}; use std::collections::HashMap; use std::path::PathBuf; @@ -14,7 +15,6 @@ use std::sync::{Arc, Mutex}; use std::time::SystemTime; use tokio::sync::mpsc::channel; use tokio::{sync::MutexGuard, task::JoinHandle}; -use log::{debug, error, info, trace}; use xbase_proto::Client; #[derive(derive_deref_rs::Deref)]