From 2ac90420c658663564a71b7ecb52d74f3c2c9d0f Mon Sep 17 00:00:00 2001 From: hinto-janai Date: Fri, 26 Apr 2024 19:49:55 -0400 Subject: [PATCH] ci: fix windows/macos (#116) * cryptonight: include homebrew directories * test-utils: add arm macos to `monerod` downloader * ci: install windows-gnu --- .github/workflows/ci.yml | 6 ++++++ cryptonight/build.rs | 5 ++++- test-utils/src/monerod/download.rs | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ebf40b12..96c7ce6a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,6 +96,12 @@ jobs: update: true install: mingw-w64-x86_64-toolchain mingw-w64-x86_64-boost msys2-runtime-devel git mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja + - name: Switch target (Windows) + if: matrix.os == 'windows-latest' + run: | + rustup toolchain install stable-x86_64-pc-windows-gnu -c clippy --no-self-update + rustup default stable-x86_64-pc-windows-gnu + - name: Documentation run: cargo doc --workspace --all-features diff --git a/cryptonight/build.rs b/cryptonight/build.rs index 0950d94c..465236ec 100644 --- a/cryptonight/build.rs +++ b/cryptonight/build.rs @@ -32,7 +32,10 @@ fn main() { // 29 | extern int ftime (struct timeb *__timebuf) // | ^~~~~ // This flag doesn't work on MSVC and breaks CI. - .flag_if_supported("-Wno-deprecated-declarations"); + .flag_if_supported("-Wno-deprecated-declarations") + // `#include ` isn't found without this in macOS CI. + // + .flag_if_supported("-I/opt/homebrew/include"); // Optimization flags are automatically added. // https://docs.rs/cc/latest/cc/struct.Build.html#method.opt_level diff --git a/test-utils/src/monerod/download.rs b/test-utils/src/monerod/download.rs index 699323f7..296b3a2b 100644 --- a/test-utils/src/monerod/download.rs +++ b/test-utils/src/monerod/download.rs @@ -29,6 +29,7 @@ fn file_name(version: &str) -> (String, String) { ("linux", "x64" | "x86_64") => format!("monero-linux-x64-{version}.tar.bz2"), ("linux", "x86") => format!("monero-linux-x86-{version}.tar.bz2"), ("macos", "x64" | "x86_64") => format!("monero-mac-x64-{version}.tar.bz2"), + ("macos", "aarch64") => format!("monero-mac-armv8-{version}.tar.bz2"), _ => panic!("Can't get monerod for {OS}, {ARCH}."), }; @@ -42,6 +43,7 @@ fn file_name(version: &str) -> (String, String) { ("macos", "x64" | "x86_64") => { format!("monero-x86_64-apple-darwin11-{version}") } + ("macos", "aarch64") => format!("monero-aarch64-apple-darwin11-{version}"), _ => panic!("Can't get monerod for {OS}, {ARCH}."), };