diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 082cdd7..a29181f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,3 +1,5 @@ +name: test suite +run-name: test suite for ${{ github.event.pull_request.title || github.ref }} on: push: branches: @@ -8,6 +10,10 @@ on: - synchronize - ready_for_review +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + env: DENO_VERSION: "2.1.2" GHJK_LOG: debug @@ -67,13 +73,15 @@ jobs: path: ${{ env.DENO_DIR }} key: deno-${{ hashFiles('**/deno.lock') }} - if: "${{ matrix.os == 'ubuntu-latest' || matrix.os == 'custom-arm' }}" + # need coreutils on max for the `timeout` command + # need cmake to build the rust deps run: | - # we need coreutils on max for the `timeout` command sudo apt update - sudo apt install -y --no-install-recommends fish zsh + sudo apt install -y --no-install-recommends fish zsh cmake - if: "${{ matrix.os == 'macos-latest' || matrix.os == 'macos-14' }}" - # we need coreutils on max for the `timeout` command - run: brew install fish zsh coreutils + # need cmake to build the rust deps + # need coreutils on max for the `timeout` command + run: brew install fish zsh coreutils cmake - run: deno task test test-action: diff --git a/src/ghjk/config.rs b/src/ghjk/config.rs index d5f937f..5157c90 100644 --- a/src/ghjk/config.rs +++ b/src/ghjk/config.rs @@ -30,14 +30,14 @@ impl Config { let xdg_dirs = directories::ProjectDirs::from("", "", "ghjk") .expect_or_log("unable to resolve home dir"); - let ghjkdir_path = match path_from_env(&cwd, "GHJK_DIR").await? { + let ghjkdir_path = match path_from_env(&cwd, "GHJK_DIR")? { Some(val) => Some(val), None => crate::utils::find_entry_recursive(&cwd, ".ghjk") .await .wrap_err("error trying to locate a .ghjk dir")?, }; - let ghjkfile_path = match path_from_env(&cwd, "GHJKFILE").await? { + let ghjkfile_path = match path_from_env(&cwd, "GHJKFILE")? { Some(val) => Some(val), None => { // NOTE: look for typescript ghjkfile @@ -102,7 +102,7 @@ impl Config { }, }; - let global_config_path = match path_from_env(&cwd, "GHJK_CONFIG_DIR").await? { + let global_config_path = match path_from_env(&cwd, "GHJK_CONFIG_DIR")? { Some(val) => val, None => xdg_dirs.config_dir().join("config"), }; @@ -262,12 +262,12 @@ hash.json", fn resolve_config_path(path: impl AsRef, config_path: &Path) -> Res { let path = config_path.join(&path); - let path = std::fs::canonicalize(&path) - .wrap_err_with(|| format!("error canonicalizing path at {path:?}"))?; + let path = std::path::absolute(&path) + .wrap_err_with(|| format!("error absolutizing path at {path:?}"))?; Ok(path) } -async fn path_from_env(cwd: &Path, env_name: &str) -> Res> { +fn path_from_env(cwd: &Path, env_name: &str) -> Res> { let path = match std::env::var(env_name) { Ok(path) => Some(PathBuf::from(path)), Err(std::env::VarError::NotUnicode(os_str)) => Some(PathBuf::from(os_str)), @@ -276,9 +276,10 @@ async fn path_from_env(cwd: &Path, env_name: &str) -> Res> { if let Some(path) = path { let path = cwd.join(&path); - Ok(Some(tokio::fs::canonicalize(&path).await.wrap_err_with( - || format!("error canonicalizing path {path:?} from env ${env_name}"), - )?)) + + Ok(Some(std::path::absolute(&path).wrap_err_with(|| { + format!("error absolutizing path {path:?} from env ${env_name}") + })?)) } else { Ok(None) }