Skip to content

Commit 7800bf2

Browse files
committed
debug: dump env vars in CI
1 parent 95e9a39 commit 7800bf2

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

.github/workflows/pixi.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,10 @@ jobs:
2525
run: |
2626
pixi run test
2727
shell: bash
28+
29+
- name: Dump Environment
30+
if: always()
31+
run: |
32+
cat env_dump.txt || echo "env_dump.txt not found"
33+
shell: bash
34+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
use std::env;
2+
use std::fs;
3+
use std::path::Path;
4+
5+
fn main() {
6+
let manifest_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
7+
let dump_path = Path::new(&manifest_dir).join("../../env_dump.txt");
8+
let env_vars = env::vars()
9+
.map(|(k, v)| format!("{}={}", k, v))
10+
.collect::<Vec<String>>()
11+
.join("\n");
12+
fs::write(dump_path, env_vars).unwrap();
13+
println!("cargo:rerun-if-changed=build.rs");
14+
}

0 commit comments

Comments
 (0)