mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-07-08 00:05:00 +00:00
Add self hosted runner to ci.yml (#955)
* Add self hosted runner to ci.yml * Remove libgtk install * Use mold as the linker * Make build logs non verbose * Fix crash on failure to get GLOBAL_PLATFORM * Copy the platform enum before calling unwrap_or_default Co-authored-by: 0hypercube <0hypercube@gmail.com>
This commit is contained in:
parent
5619d44300
commit
b030a1860b
3 changed files with 7 additions and 10 deletions
11
.github/workflows/ci.yml
vendored
11
.github/workflows/ci.yml
vendored
|
@ -12,7 +12,7 @@ env:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: self-hosted
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
@ -27,9 +27,6 @@ jobs:
|
||||||
cd frontend
|
cd frontend
|
||||||
npm ci
|
npm ci
|
||||||
|
|
||||||
- name: 🔧 Install libgtk
|
|
||||||
run: sudo apt update -y && sudo apt install -y libgtk-3-dev libssl-dev build-essential curl wget libayatana-appindicator3-dev librsvg2-dev libsoup2.4-dev libjavascriptcoregtk-4.0-dev libwebkit2gtk-4.0-dev
|
|
||||||
|
|
||||||
- name: 🔼 Update Rust to latest stable
|
- name: 🔼 Update Rust to latest stable
|
||||||
run: |
|
run: |
|
||||||
rustc --version
|
rustc --version
|
||||||
|
@ -53,15 +50,15 @@ jobs:
|
||||||
|
|
||||||
- name: 🔬 Check Rust formatting
|
- name: 🔬 Check Rust formatting
|
||||||
run: |
|
run: |
|
||||||
cargo fmt --all -- --check
|
mold -run cargo fmt --all -- --check
|
||||||
|
|
||||||
- name: 🦀 Build Rust code
|
- name: 🦀 Build Rust code
|
||||||
run: |
|
run: |
|
||||||
cargo build --verbose
|
mold -run cargo build
|
||||||
|
|
||||||
- name: 🧪 Run Rust tests
|
- name: 🧪 Run Rust tests
|
||||||
run: |
|
run: |
|
||||||
cargo test --verbose
|
mold -run cargo test
|
||||||
|
|
||||||
cargo-deny:
|
cargo-deny:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
|
@ -141,7 +141,7 @@ impl Dispatcher {
|
||||||
.process_message(message, (&self.message_handlers.input_preprocessor_message_handler, actions), &mut queue);
|
.process_message(message, (&self.message_handlers.input_preprocessor_message_handler, actions), &mut queue);
|
||||||
}
|
}
|
||||||
InputPreprocessor(message) => {
|
InputPreprocessor(message) => {
|
||||||
let keyboard_platform = GLOBAL_PLATFORM.get().expect("Failed to get GLOBAL_PLATFORM").as_keyboard_platform_layout();
|
let keyboard_platform = GLOBAL_PLATFORM.get().copied().unwrap_or_default().as_keyboard_platform_layout();
|
||||||
|
|
||||||
self.message_handlers.input_preprocessor_message_handler.process_message(message, keyboard_platform, &mut queue);
|
self.message_handlers.input_preprocessor_message_handler.process_message(message, keyboard_platform, &mut queue);
|
||||||
}
|
}
|
||||||
|
|
|
@ -224,7 +224,7 @@ impl fmt::Display for Key {
|
||||||
return write!(f, "{}", key_name.chars().skip(KEY_PREFIX.len()).collect::<String>());
|
return write!(f, "{}", key_name.chars().skip(KEY_PREFIX.len()).collect::<String>());
|
||||||
}
|
}
|
||||||
|
|
||||||
let keyboard_layout = || GLOBAL_PLATFORM.get().expect("Failed to get GLOBAL_PLATFORM").as_keyboard_platform_layout();
|
let keyboard_layout = || GLOBAL_PLATFORM.get().copied().unwrap_or_default().as_keyboard_platform_layout();
|
||||||
|
|
||||||
let name = match self {
|
let name = match self {
|
||||||
// Writing system keys
|
// Writing system keys
|
||||||
|
@ -338,7 +338,7 @@ impl fmt::Display for KeysGroup {
|
||||||
.0
|
.0
|
||||||
.iter()
|
.iter()
|
||||||
.map(|key| {
|
.map(|key| {
|
||||||
let keyboard_layout = GLOBAL_PLATFORM.get().expect("Failed to get GLOBAL_PLATFORM").as_keyboard_platform_layout();
|
let keyboard_layout = GLOBAL_PLATFORM.get().copied().unwrap_or_default().as_keyboard_platform_layout();
|
||||||
let key_is_modifier = matches!(*key, Key::Control | Key::Command | Key::Alt | Key::Shift | Key::Meta | Key::Accel);
|
let key_is_modifier = matches!(*key, Key::Control | Key::Command | Key::Alt | Key::Shift | Key::Meta | Key::Accel);
|
||||||
|
|
||||||
if keyboard_layout == KeyboardPlatformLayout::Mac && key_is_modifier {
|
if keyboard_layout == KeyboardPlatformLayout::Mac && key_is_modifier {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue