chore: Add Windows CI (#789)
This commit is contained in:
parent
aa44fd3a43
commit
71b79cf1b4
2 changed files with 54 additions and 39 deletions
29
.github/workflows/ci.yml
vendored
29
.github/workflows/ci.yml
vendored
|
|
@ -3,20 +3,32 @@ on:
|
||||||
pull_request:
|
pull_request:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- '*'
|
- "*"
|
||||||
tags:
|
tags:
|
||||||
- '*'
|
- "*"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
name: Test
|
name: Test
|
||||||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
|
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
|
||||||
runs-on: macos-latest
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- target: aarch64-apple-darwin
|
||||||
|
run_on: macos-latest
|
||||||
|
- target: x86_64-linux-gnu
|
||||||
|
run_on: ubuntu-latest
|
||||||
|
- target: x86_64-windows-msvc
|
||||||
|
run_on: windows-latest
|
||||||
|
runs-on: ${{ matrix.run_on }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Install system dependencies
|
- name: Install system dependencies
|
||||||
|
if: ${{ matrix.run_on != 'windows-latest' }}
|
||||||
run: script/bootstrap
|
run: script/bootstrap
|
||||||
- name: Machete
|
- name: Machete
|
||||||
|
if: ${{ matrix.run_on == 'macos-latest' }}
|
||||||
uses: bnjbvr/cargo-machete@main
|
uses: bnjbvr/cargo-machete@main
|
||||||
- name: Setup | Cache Cargo
|
- name: Setup | Cache Cargo
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
|
|
@ -27,13 +39,16 @@ jobs:
|
||||||
~/.cargo/registry/cache/
|
~/.cargo/registry/cache/
|
||||||
~/.cargo/git/db/
|
~/.cargo/git/db/
|
||||||
target/
|
target/
|
||||||
key: ubuntu-test-cargo-${{ hashFiles('**/Cargo.lock') }}
|
key: test-cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
|
||||||
- name: Install Tools
|
- name: Typo check
|
||||||
run: cargo install typos-cli || echo "typos-cli already installed"
|
if: ${{ matrix.run_on == 'macos-latest' }}
|
||||||
|
run: |
|
||||||
|
cargo install typos-cli || echo "typos-cli already installed"
|
||||||
|
typos
|
||||||
- name: Lint
|
- name: Lint
|
||||||
|
if: ${{ matrix.run_on == 'macos-latest' }}
|
||||||
run: |
|
run: |
|
||||||
cargo clippy -- --deny warnings
|
cargo clippy -- --deny warnings
|
||||||
typos
|
|
||||||
- name: Build test
|
- name: Build test
|
||||||
run: |
|
run: |
|
||||||
cargo test --all
|
cargo test --all
|
||||||
|
|
|
||||||
|
|
@ -212,38 +212,7 @@ mod tests {
|
||||||
use super::Kbd;
|
use super::Kbd;
|
||||||
use gpui::Keystroke;
|
use gpui::Keystroke;
|
||||||
|
|
||||||
if cfg!(target_os = "windows") {
|
if cfg!(target_os = "macos") {
|
||||||
assert_eq!(Kbd::format(&Keystroke::parse("a").unwrap()), "A");
|
|
||||||
assert_eq!(Kbd::format(&Keystroke::parse("ctrl-a").unwrap()), "Ctrl+A");
|
|
||||||
assert_eq!(
|
|
||||||
Kbd::format(&Keystroke::parse("shift-space").unwrap()),
|
|
||||||
"Shift+Space"
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
Kbd::format(&Keystroke::parse("ctrl-alt-a").unwrap()),
|
|
||||||
"Ctrl+Alt+A"
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
Kbd::format(&Keystroke::parse("ctrl-alt-shift-a").unwrap()),
|
|
||||||
"Ctrl+Alt+Shift+A"
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
Kbd::format(&Keystroke::parse("ctrl-alt-shift-win-a").unwrap()),
|
|
||||||
"Ctrl+Alt+Shift+Win+A"
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
Kbd::format(&Keystroke::parse("ctrl-shift-backspace").unwrap()),
|
|
||||||
"Ctrl+Shift+Backspace"
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
Kbd::format(&Keystroke::parse("alt-delete").unwrap()),
|
|
||||||
"Alt+Delete"
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
Kbd::format(&Keystroke::parse("alt-tab").unwrap()),
|
|
||||||
"Alt+Tab"
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
assert_eq!(Kbd::format(&Keystroke::parse("cmd-a").unwrap()), "⌘A");
|
assert_eq!(Kbd::format(&Keystroke::parse("cmd-a").unwrap()), "⌘A");
|
||||||
assert_eq!(Kbd::format(&Keystroke::parse("cmd-enter").unwrap()), "⌘⏎");
|
assert_eq!(Kbd::format(&Keystroke::parse("cmd-enter").unwrap()), "⌘⏎");
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
|
|
@ -279,6 +248,37 @@ mod tests {
|
||||||
Kbd::format(&Keystroke::parse("cmd-ctrl-shift-alt-a").unwrap()),
|
Kbd::format(&Keystroke::parse("cmd-ctrl-shift-alt-a").unwrap()),
|
||||||
"⌃⌥⇧⌘A"
|
"⌃⌥⇧⌘A"
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
assert_eq!(Kbd::format(&Keystroke::parse("a").unwrap()), "A");
|
||||||
|
assert_eq!(Kbd::format(&Keystroke::parse("ctrl-a").unwrap()), "Ctrl+A");
|
||||||
|
assert_eq!(
|
||||||
|
Kbd::format(&Keystroke::parse("shift-space").unwrap()),
|
||||||
|
"Shift+Space"
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
Kbd::format(&Keystroke::parse("ctrl-alt-a").unwrap()),
|
||||||
|
"Ctrl+Alt+A"
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
Kbd::format(&Keystroke::parse("ctrl-alt-shift-a").unwrap()),
|
||||||
|
"Ctrl+Alt+Shift+A"
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
Kbd::format(&Keystroke::parse("ctrl-alt-shift-win-a").unwrap()),
|
||||||
|
"Ctrl+Alt+Shift+Win+A"
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
Kbd::format(&Keystroke::parse("ctrl-shift-backspace").unwrap()),
|
||||||
|
"Ctrl+Shift+Backspace"
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
Kbd::format(&Keystroke::parse("alt-delete").unwrap()),
|
||||||
|
"Alt+Delete"
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
Kbd::format(&Keystroke::parse("alt-tab").unwrap()),
|
||||||
|
"Alt+Tab"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue