Fix software tests, and improve their timing #19
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: Tests | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
# Allow job to be triggered manually. | |
workflow_dispatch: | |
# Cancel in-progress jobs when pushing to the same branch. | |
concurrency: | |
cancel-in-progress: true | |
group: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
tests: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ["ubuntu-latest"] | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
env: | |
OS: ${{ matrix.os }} | |
PYTHON: ${{ matrix.python-version }} | |
name: Python ${{ matrix.python-version }} on OS ${{ matrix.os }} | |
steps: | |
- name: Install prerequisites | |
run: | | |
sudo apt update | |
sudo apt install --no-install-recommends --no-install-suggests --yes mosquitto-clients tshark | |
- name: Acquire sources | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: x64 | |
cache: 'pip' | |
cache-dependency-path: | | |
requirements-*.txt | |
- name: Environment information | |
run: | | |
set -x | |
sudo ifconfig | |
sudo tshark --list-interfaces | |
sudo tshark --list-data-link-types -i lo | |
sudo tshark --list-data-link-types -i eth0 | |
sudo tshark --list-data-link-types -i docker0 | |
- name: Setup project | |
run: | | |
pip install --use-pep517 --prefer-binary --requirement requirements-tests.txt | |
- name: Run linter and software tests | |
run: | | |
pytest |