update atspi_test
for improving CIs
#255
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: atspi CI | |
on: | |
push: | |
branches: [ "atspi" ] | |
pull_request: | |
branches: [ "atspi" ] | |
jobs: | |
Linux: | |
runs-on: ${{ matrix.os }} | |
container: ${{ matrix.container }} | |
timeout-minutes: 30 | |
strategy: | |
max-parallel: 1 | |
fail-fast: false | |
matrix: | |
os : [ubuntu-20.04] # python-xlib cannot work with ubuntu-22.04 | |
python: ['3.7', '3.8', '3.9', '3.10', '3.11'] | |
include: | |
- os: ubuntu-20.04 | |
python: 2.7 | |
container: python:2.7.18-buster | |
env: | |
DISPLAY: ':0' | |
steps: | |
- name: get repo | |
uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python }} | |
if: ${{ ! ( matrix.python == '2.7' ) }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
sudo apt update -y | |
sudo apt upgrade | |
sudo apt install -y --no-install-recommends python-setuptools tk-dev python-tk | |
sudo apt install -y --no-install-recommends python3 python3-pip python3-setuptools | |
sudo apt install -y --no-install-recommends python-xlib | |
sudo apt install -y --no-install-recommends xsel | |
sudo apt install -y libjavascriptcoregtk-4.0-18 | |
pip install coverage codecov | |
pip install python-xlib --upgrade | |
pip install mock --upgrade | |
python -m pip install pytest | |
sudo apt install -y build-essential libssl-dev | |
sudo apt install -y qt5-default | |
sudo apt install -y libxkbcommon-x11-0 | |
sudo apt install -y python3-gi gobject-introspection gir1.2-gtk-3.0 | |
sudo apt install -y at-spi2-core | |
sudo apt install -y python3-pyatspi | |
sudo apt install -y xvfb x11-utils libxkbcommon-x11-0 \ | |
libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 \ | |
libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 xdotool | |
#pip3 install scikit-build # required for cmake>=3.23.0 | |
pip3 install cmake==3.22.6 | |
- name: Install test apps | |
run: | | |
git init apps | |
cd apps | |
git remote add -f origin https://github.com/pywinauto/PywinautoTestapps/ | |
git config core.sparseCheckout true | |
echo "MouseTester/source" >> .git/info/sparse-checkout | |
echo "SendKeysTester/source" >> .git/info/sparse-checkout | |
git pull origin master | |
cd MouseTester/source | |
qmake | |
make | |
chmod a+x mousebuttons | |
cp mousebuttons ../ | |
cd ../.. | |
cd SendKeysTester/source | |
qmake | |
make | |
chmod a+x send_keys_test_app | |
cp send_keys_test_app ../ | |
export XDG_RUNTIME_DIR=/tmp/runtime-runner | |
- name: Remote display start | |
run: | | |
sudo /usr/bin/Xvfb $DISPLAY -screen 0 1280x1024x24 & | |
sleep 5 | |
set +eE | |
sudo apt install -y gdm3 | |
sudo service gdm start | |
sleep 5 | |
- name: Run tests | |
run: | | |
coverage run -m pytest pywinauto/unittests/test_atspi_element_info.py pywinauto/unittests/test_atspi_wrapper.py pywinauto/unittests/test_atspi_controls.py pywinauto/unittests/test_clipboard_linux.py pywinauto/unittests/test_keyboard.py pywinauto/unittests/test_application_linux.py -vv | |
- name: Upload Coverage to Codecov | |
uses: codecov/codecov-action@v3 |