Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: try to fix the tests on windows #132

Closed
wants to merge 20 commits into from
Closed
55 changes: 17 additions & 38 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,45 +18,24 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
include:
- os: ubuntu-latest
headless: Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
- os: macos-latest
extra: -- --skip test_simple
# os: [macos-latest, ubuntu-latest, windows-latest]
os: [windows-latest]
# include:
# - os: ubuntu-latest
# headless: Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
# - os: macos-latest
# extra: -- --skip test_simple

steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
# - if: matrix.os == 'ubuntu-latest'
# uses: awalsh128/cache-apt-pkgs-action@latest
# with:
# packages: libxtst-dev libevdev-dev libxdo-dev
# version: 1.0

- if: matrix.os == 'ubuntu-latest'
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libxtst-dev libevdev-dev libxdo-dev
version: 1.0

- name: Add components
run: rustup component add clippy rustfmt

- name: Setup headless environment
run: ${{matrix.headless}}

- name: Rustfmt
- if: matrix.os == 'windows-latest'
run: |
cargo fmt -- --check

- name: Clippy
run: cargo clippy --all-targets --all-features -- -D warnings

- name: Build
run: cargo build --all-features --verbose

- name: Run tests (minimal)
run: cargo test --no-default-features --lib --bins --tests --verbose ${{matrix.extra}}

- name: Run tests (normal)
run: cargo test --lib --bins --tests --verbose ${{matrix.extra}}

- name: Run tests (full)
run: cargo test --all-features --lib --bins --tests --verbose ${{matrix.extra}}

curl "https://dl.activestate.com/camel-builds/ActiveTcl/MSWin32-x64/20230607T174924Z/ActiveTcl-8.6.13.0000-MSWin32-x64-559160e0.msi" -o tcl.msi
./tcl.msi /quiet
del "c:/Program Files (x86)/mingw64/bin/wish"
which wish
9 changes: 6 additions & 3 deletions service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ mod tests {
wm protocol . WM_DELETE_WINDOW {destroy .};
"#,
);
thread::sleep(Duration::from_secs(1));

input_field
}

Expand All @@ -236,11 +236,14 @@ mod tests {
// To detect excessive backspace
const LIMIT: &str = "bbb";

// Start the sandbox
let textfield = start_sandbox(LIMIT);

// Start the afrim
start_afrim();

// Start the sandbox
let textfield = start_sandbox(LIMIT);
// We afrim to start
thread::sleep(Duration::from_secs(1));

rdev::simulate(&MouseMove { x: 100.0, y: 100.0 }).unwrap();
thread::sleep(typing_speed_ms);
Expand Down
Loading