From d5181679558109f8ee58ba774eac6f955612b089 Mon Sep 17 00:00:00 2001 From: Romain Bezut Date: Thu, 26 Sep 2024 00:18:36 +0200 Subject: [PATCH] github: add a new workflow for tests. Signed-off-by: Romain Bezut --- .github/workflows/mypy.yml | 6 ++---- .github/workflows/pytest.yml | 23 +++++++++++++++++++++++ .github/workflows/ruff.yml | 2 +- 3 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/pytest.yml diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index 48e9cdb..ccbd0c1 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -1,4 +1,4 @@ -name: "Type checks with MyPy" +name: "Check typing with MyPy" on: push: paths: @@ -22,8 +22,6 @@ jobs: with: python-version: ${{ env.PYTHON_VERSION }} - name: "Install linting dependendies" - run: | - python -m pip install --upgrade pip - make install install-linting + run: make install-package install-linting - name: "Run mypy" run: mypy diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml new file mode 100644 index 0000000..0d42239 --- /dev/null +++ b/.github/workflows/pytest.yml @@ -0,0 +1,23 @@ +name: "Test package with pytest" +on: [push, pull_request, workflow_dispatch] + +jobs: + pytest: + name: "Run tests" + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.9", "3.10", "3.11", "3.12"] + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: "Install testing dependendies" + run: make install-testing + - name: "Test the package" + run: pytest --cov=aio_ld2410 -v -s + - name: "Generate a coverage report" + run: coverage report --show-missing + if: success() || failure() diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yml index 30b0476..970c0cf 100644 --- a/.github/workflows/ruff.yml +++ b/.github/workflows/ruff.yml @@ -1,4 +1,4 @@ -name: "Linting checks with ruff" +name: "Check linting with ruff" on: push: paths: