From f5ed24fbb5bec8194e65b6307c3264a4e696ec98 Mon Sep 17 00:00:00 2001 From: Ivan Habunek Date: Wed, 3 Jul 2024 11:46:13 +0200 Subject: [PATCH] Add github action for running tests --- .github/workflows/test.yaml | 28 ++++++++++++++++++++++++++++ .vermin | 4 ++++ pyproject.toml | 5 ++++- 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/test.yaml create mode 100644 .vermin diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..9001d7c --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,28 @@ +name: Run tests + +on: [push, pull_request] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + + steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -e ".[test]" + - name: Run tests + run: | + pytest + - name: Validate minimum required version + run: | + vermin pdf417gen diff --git a/.vermin b/.vermin new file mode 100644 index 0000000..cf26af3 --- /dev/null +++ b/.vermin @@ -0,0 +1,4 @@ +[vermin] +only_show_violations = yes +show_tips = no +targets = 3.6- diff --git a/pyproject.toml b/pyproject.toml index 16f2bb4..8a61ea3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,10 +34,13 @@ packages = [ [project.optional-dependencies] dev = [ "build", + "twine", +] + +test = [ "mock", "pytest", "pytest-cov", - "twine", "vermin", ]