From 840d0b4923dee7a925c3982972f8dc95001db63c Mon Sep 17 00:00:00 2001 From: Simon Humpohl Date: Fri, 15 Mar 2024 16:27:38 +0100 Subject: [PATCH 1/2] Add test env to hatch --- pyproject.toml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index cc64023..ae088f9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,3 +47,14 @@ path = "qupulse_mfli/__init__.py" include = [ "/qupulse_mfli", ] + +[tool.hatch.envs.default] +dependencies = [ + "pytest", "pytest-benchmark" +] +[tool.hatch.envs.default.scripts] +test = "python -m pytest {args:tests}" + + +[[tool.hatch.envs.all.matrix]] +python = ["3.8", "3.9", "3.10", "3.11", "3.12"] From 21705ba7a30696bb2e469eace07e860503eedee7 Mon Sep 17 00:00:00 2001 From: Simon Humpohl Date: Fri, 15 Mar 2024 16:30:53 +0100 Subject: [PATCH 2/2] Add github workflow for test --- .github/workflows/pythontest.yaml | 34 +++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/pythontest.yaml diff --git a/.github/workflows/pythontest.yaml b/.github/workflows/pythontest.yaml new file mode 100644 index 0000000..875cd02 --- /dev/null +++ b/.github/workflows/pythontest.yaml @@ -0,0 +1,34 @@ +name: Pytest + +on: + workflow_dispatch: + pull_request: + types: + - opened + - reopened + - synchronize + branches: + - '**' + paths: + - 'qupulse_mfli/**y' + - 'tests/**' + - 'pyproject.toml' + +jobs: + run: + name: "tests" + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.9 + uses: actions/setup-python@v5 + with: + python-version: 3.9 + + - name: Install hatch + run: | + python -m pip install hatch + + - name: Tests + run: python -m hatch run test