Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pythonbrad committed May 3, 2023
1 parent 70f34e1 commit f9a666c
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 61 deletions.
11 changes: 0 additions & 11 deletions .github/actions/install_deps/action.yml

This file was deleted.

90 changes: 40 additions & 50 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,57 +7,47 @@ on:
pull_request:
branches: [main, release-*]

env:
CARGO_TERM_COLOR: always

jobs:
clippy_workspace:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/install_deps
- name: Add clippy
uses: actions-rs/toolchain@v1.0.6
with:
profile: minimal
default: true
components: clippy
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --all-targets -- -D warnings
build:

rust_fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/install_deps
- name: Add rustfmt
uses: actions-rs/toolchain@v1.0.6
with:
profile: minimal
default: true
components: rustfmt
- uses: Swatinem/rust-cache@v2
- run: |
cargo fmt -- --check
rust_build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/install_deps
- uses: Swatinem/rust-cache@v2
- run: cargo build --all-features --verbose
runs-on: ${{matrix.os}}
env:
DISPLAY: ':99'
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: ubuntu-latest
dependencies: sudo apt-get install libxtst-dev libevdev-dev --assume-yes
- os: macos-latest
# TODO: We can't test this on github, we can't set accessibility yet.
test: cargo test --verbose --all-features -- --skip test_listen_and_simulate --skip test_grab
- os: ubuntu-latest
# TODO unstable_grab feature is not supported on Linux.
test: cargo test --verbose --features=serialize
- os: windows-latest
test: cargo test --verbose --all-features

run_tests:
name: Run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/install_deps
- uses: Swatinem/rust-cache@v2
- run: |
cargo test --all-features --lib --bins --tests --verbose
cargo test --benches
- uses: actions/checkout@v2
- name: CargoFmt
run: rustup component add rustfmt
- name: Dependencies
run: ${{matrix.dependencies}}
- name: Setup headless environment
run: ${{matrix.headless}}
- name: Check formatting
run: |
rustup component add rustfmt
cargo fmt -- --check
- name: Build
run: cargo build --verbose
- name: Run tests
run: ${{matrix.test}}
- name: Linter
run: |
rustup component add clippy
cargo clippy --all-features --verbose -- -Dwarnings

0 comments on commit f9a666c

Please sign in to comment.