diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml new file mode 100644 index 0000000..d2713bb --- /dev/null +++ b/.github/workflows/ci-windows.yml @@ -0,0 +1,29 @@ +name: Buckle Windows CI + +on: + push: + branches: + - main + pull_request: + branches: + - main + +permissions: + contents: read + +jobs: + build: + runs-on: windows-2022 + steps: + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + default: true + components: rustfmt, clippy + - name: Build + run: cargo build + - name: Test + run: cargo test + - name: Lint + run: cargo clippy diff --git a/src/main.rs b/src/main.rs index ce3ecb5..8bcebf1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -141,7 +141,7 @@ fn get_arch() -> Result<&'static str, Error> { "x86_64" => match env::consts::OS { "linux" => "x86_64-unknown-linux-musl", "darwin" | "macos" => "x86_64-apple-darwin", - "windows" => "x86_64-pc-windows-msvc", + "windows" => "x86_64-pc-windows-msvc.exe", unknown => return Err(anyhow!("Unsupported Arch/OS: x86_64/{unknown}")), }, "aarch64" => match env::consts::OS { diff --git a/tests/integration_buck2.rs b/tests/integration_buck2.rs index 20ff643..8ebdcd5 100644 --- a/tests/integration_buck2.rs +++ b/tests/integration_buck2.rs @@ -8,7 +8,14 @@ fn test_buck2_latest() { cmd.arg("--version"); let assert = cmd.assert(); let stdout = String::from_utf8(assert.get_output().stdout.to_vec()).unwrap(); - assert!(stdout.starts_with("buck2 "), "found {}", stdout); + let stderr = String::from_utf8(assert.get_output().stderr.to_vec()).unwrap(); + + assert!( + stdout.starts_with("buck2 "), + "found {} on stdout. stderr was {}", + stdout, + stderr + ); assert.success(); } @@ -22,6 +29,12 @@ fn test_buck2_specific_version() { // TODO verify the right version is download after buck2 properly states it's version let assert = cmd.assert(); let stdout = String::from_utf8(assert.get_output().stdout.to_vec()).unwrap(); - assert!(stdout.starts_with("buck2 "), "found {}", stdout); + let stderr = String::from_utf8(assert.get_output().stderr.to_vec()).unwrap(); + assert!( + stdout.starts_with("buck2 "), + "found {} on stdout. stderr was {}", + stdout, + stderr + ); assert.success(); }