Skip to content

Commit

Permalink
Try to make tests work in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
shiro committed Nov 21, 2023
1 parent 26e9c43 commit a0c22ab
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 10 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
matrix:
target: [x86_64, x86,
# aarch64, armv7, s390x, ppc64le
# aarch64, armv7, s390x, ppc64le
]
steps:
- uses: actions/checkout@v3
Expand All @@ -29,10 +29,18 @@ jobs:
- name: Git submodule init
run: git submodule sync --recursive && git submodule update --init --force; ls -la evdev-rs/evdev-sys/libevdev

# install python & rust
- uses: actions/setup-python@v4
with:
python-version: 3.9
architecture: x64
- uses: dtolnay/rust-toolchain@nightly

# run tests
- name: Setup test dependencies
run: ./ci/prepare-ci-test.sh
- name: Test
run: source .env/bin/activate && ./test.sh

- name: Build wheels
uses: PyO3/maturin-action@v1
Expand All @@ -42,9 +50,7 @@ jobs:
rust-toolchain: nightly
sccache: 'true'
manylinux: auto
before-script-linux: "./ci/prepare-ci.sh"
- name: foo
run: ls -la dist
before-script-linux: "./ci/prepare-ci-container.sh"
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ edition = "2018"

[features]
integration = []
extension-module = ["pyo3/extension-module"]
default = ["extension-module"]

[lib]
name = "map2"
Expand Down Expand Up @@ -36,8 +38,7 @@ xdg = "2.2.0"
atty = "0.2"
indoc = "1.0"
futures-intrusive = "0.4.0"
#pyo3 = { version = "0.20.0", extension-module = ["extension-module"], default = ["extension-module"] }
pyo3 = { version = "0.20.0", features = ["extension-module"] }
pyo3 = { version = "0.20.0" }
pyo3-asyncio = { version = "0.20.0", features = ["attributes", "tokio-runtime", "testing"] }
oneshot = "0.1.2"
signal-hook = "0.3.17"
Expand Down
1 change: 0 additions & 1 deletion ci/prepare-ci.sh → ci/prepare-ci-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

set -e

#rustup default nightly

yum install -y libxkbcommon-devel

Expand Down
9 changes: 9 additions & 0 deletions ci/prepare-ci-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

set -e

sudo apt-get install -y libxkbcommon-dev

python -m venv .env
source .env/bin/activate
pip install maturin
2 changes: 1 addition & 1 deletion examples/hello_world.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import map2
import time

map2.default(layout = "rabbit")
map2.default()

writer = map2.Writer(capabilities = {"rel": True, "buttons": True})

Expand Down
2 changes: 1 addition & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

set -e

cargo test --features integration
cargo test --no-default-features --features integration

0 comments on commit a0c22ab

Please sign in to comment.