feat(ci): first draft of modulo caching
This commit is contained in:
parent
c244642459
commit
89aca32b09
22
.github/workflows/ci.yml
vendored
22
.github/workflows/ci.yml
vendored
|
@ -12,6 +12,7 @@ on:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
|
WX_WIDGETS_BUILD_OUT_DIR: "wx-widgets-build"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
@ -37,6 +38,13 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
cargo install rust-script --version "0.7.0"
|
cargo install rust-script --version "0.7.0"
|
||||||
cargo install cargo-make --version 0.34.0
|
cargo install cargo-make --version 0.34.0
|
||||||
|
- name: "Cache wxWidgets builds"
|
||||||
|
if: ${{ runner.os != 'Linux' }}
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
wx-widgets-build/
|
||||||
|
key: ${{ runner.os }}-${{ hashFiles('espanso-modulo/build.rs') }}-${{ hashFiles('espanso-modulo/vendor/*') }}
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
cargo make build-binary
|
cargo make build-binary
|
||||||
|
@ -70,6 +78,13 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
cargo install rust-script --version "0.7.0"
|
cargo install rust-script --version "0.7.0"
|
||||||
cargo install cargo-make --version 0.34.0
|
cargo install cargo-make --version 0.34.0
|
||||||
|
- name: "Cache wxWidgets builds"
|
||||||
|
if: ${{ runner.os != 'Linux' }}
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
wx-widgets-build/
|
||||||
|
key: ${{ runner.os }}-${{ hashFiles('espanso-modulo/build.rs') }}-${{ hashFiles('espanso-modulo/vendor/*') }}
|
||||||
- name: Run test suite
|
- name: Run test suite
|
||||||
run: cargo make test-binary
|
run: cargo make test-binary
|
||||||
|
|
||||||
|
@ -128,6 +143,13 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
cargo install rust-script --version "0.7.0"
|
cargo install rust-script --version "0.7.0"
|
||||||
cargo install cargo-make --version 0.34.0
|
cargo install cargo-make --version 0.34.0
|
||||||
|
- name: "Cache wxWidgets builds"
|
||||||
|
if: ${{ runner.os != 'Linux' }}
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
wx-widgets-build/
|
||||||
|
key: ${{ runner.os }}-${{ hashFiles('espanso-modulo/build.rs') }}-${{ hashFiles('espanso-modulo/vendor/*') }}
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
cargo make build-macos-arm-binary
|
cargo make build-macos-arm-binary
|
||||||
|
|
|
@ -25,6 +25,9 @@ use std::path::Path;
|
||||||
#[cfg(not(target_os = "linux"))]
|
#[cfg(not(target_os = "linux"))]
|
||||||
const WX_WIDGETS_ARCHIVE_NAME: &str = "wxWidgets-3.1.5.zip";
|
const WX_WIDGETS_ARCHIVE_NAME: &str = "wxWidgets-3.1.5.zip";
|
||||||
|
|
||||||
|
#[cfg(not(target_os = "linux"))]
|
||||||
|
const WX_WIDGETS_BUILD_OUT_DIR_ENV_NAME: &str = "WX_WIDGETS_BUILD_OUT_DIR";
|
||||||
|
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
fn build_native() {
|
fn build_native() {
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
|
@ -36,7 +39,17 @@ fn build_native() {
|
||||||
panic!("could not find wxWidgets archive!");
|
panic!("could not find wxWidgets archive!");
|
||||||
}
|
}
|
||||||
|
|
||||||
let out_dir = PathBuf::from(std::env::var("OUT_DIR").expect("missing OUT_DIR"));
|
let out_dir = if let Ok(out_path) = std::env::var(WX_WIDGETS_BUILD_OUT_DIR_ENV_NAME) {
|
||||||
|
println!(
|
||||||
|
"detected wxWidgets build output directory override: {}",
|
||||||
|
out_path
|
||||||
|
);
|
||||||
|
let path = PathBuf::from(out_path);
|
||||||
|
std::fs::create_dir_all(&path).expect("unable to create wxWidgets out dir");
|
||||||
|
path
|
||||||
|
} else {
|
||||||
|
PathBuf::from(std::env::var("OUT_DIR").expect("missing OUT_DIR"))
|
||||||
|
};
|
||||||
let out_wx_dir = out_dir.join("wx");
|
let out_wx_dir = out_dir.join("wx");
|
||||||
|
|
||||||
if !out_wx_dir.is_dir() {
|
if !out_wx_dir.is_dir() {
|
||||||
|
@ -154,7 +167,17 @@ fn build_native() {
|
||||||
panic!("could not find wxWidgets archive!");
|
panic!("could not find wxWidgets archive!");
|
||||||
}
|
}
|
||||||
|
|
||||||
let out_dir = PathBuf::from(std::env::var("OUT_DIR").expect("missing OUT_DIR"));
|
let out_dir = if let Ok(out_path) = std::env::var(WX_WIDGETS_BUILD_OUT_DIR_ENV_NAME) {
|
||||||
|
println!(
|
||||||
|
"detected wxWidgets build output directory override: {}",
|
||||||
|
out_path
|
||||||
|
);
|
||||||
|
let path = PathBuf::from(out_path);
|
||||||
|
std::fs::create_dir_all(&path).expect("unable to create wxWidgets out dir");
|
||||||
|
path
|
||||||
|
} else {
|
||||||
|
PathBuf::from(std::env::var("OUT_DIR").expect("missing OUT_DIR"))
|
||||||
|
};
|
||||||
let out_wx_dir = out_dir.join("wx");
|
let out_wx_dir = out_dir.join("wx");
|
||||||
|
|
||||||
let target_arch = match std::env::var("CARGO_CFG_TARGET_ARCH")
|
let target_arch = match std::env::var("CARGO_CFG_TARGET_ARCH")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user