Fix tests #45
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-latest" | |
strategy: | |
matrix: | |
python-version: ["3.9", "3.10", "3.11"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup udev device correctly | |
run: | | |
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: Setup v4l2loopback | |
uses: awalsh128/cache-apt-pkgs-action@latest | |
with: | |
packages: v4l2loopback-dkms | |
- 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: ward |