Skip to content

Commit

Permalink
fix: use GITHUB_ACTIONS env var to determine if in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
MicaiahReid committed Sep 25, 2023
1 parent 88b8398 commit d530352
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,18 @@ impl StacksDevnetApiK8sManager {
let context = match env::var("KUBE_CONTEXT") {
Ok(context) => Some(context),
Err(_) => {
// if no context is supplied and we're running a test,
// specify a local context so we don't deploy a bunch of
// test assets
if cfg!(test) {
Some(format!("kind-kind"))
let is_ci = match env::var("GITHUB_ACTIONS") {
Ok(is_ci) => is_ci == format!("true"),
Err(_) => false,
};
if is_ci {
None
} else {
// ensures that if no context is supplied and we're running
// tests locally, we deploy to the local kind cluster
Some(format!("kind-kind"))
}
} else {
None
}
Expand Down

0 comments on commit d530352

Please sign in to comment.