Try to make all tests work on github-actions #64
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: Test suite | |
on: | |
push: | |
branches: ["master"] | |
pull_request: | |
branches: ["master"] | |
jobs: | |
tests: | |
name: "Python ${{ matrix.python-version }}" | |
runs-on: "ubuntu-20.04" | |
strategy: | |
matrix: | |
python-version: ["3.9", "3.10", "3.11"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup udev device correctly | |
run: | | |
sudo usermod -aG input,audio $USER | |
sudo -s -u ${USER} bash -c 'whoami && groups' | |
sudo modprobe -i uinput | |
echo KERNEL==\"uinput\", SUBSYSTEM==\"misc\" GROUP=\"docker\", MODE:=\"0666\" | sudo tee /etc/udev/rules.d/99-$USER.rules | |
echo KERNEL==\"event[0-9]*\", SUBSYSTEM==\"input\" GROUP=\"docker\", MODE:=\"0666\" | sudo tee -a /etc/udev/rules.d/99-$USER.rules | |
cat /etc/udev/rules.d/99-$USER.rules | |
sudo udevadm control --reload-rules | |
sudo udevadm trigger | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
# Issue ref: https://github.com/actions/setup-python/issues/436 | |
# cache: 'pip' | |
# cache-dependency-path: pyproject.toml | |
- uses: actions/cache@v3 | |
id: cache | |
with: | |
path: ${{ env.pythonLocation }} | |
key: python-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }} | |
- name: Install dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: | | |
pip install --disable-pip-version-check -e .[dev] | |
- name: Linting | |
run: | | |
scripts/lint.sh | |
- name: Build package | |
run: | | |
python -m build | |
twine check dist/* | |
- name: Tests | |
run: | | |
pwd | |
sudo -s -u $USER bash -c pwd | |
type python | |
sudo -s -E -u $USER bash -c 'type python' | |
sudo -s -E -u $USER bash -c 'python -m ward' | |
- name: Tests under bash | |
run: sudo -s -u $USER bash -c ward |