From b57db31e4768c3296889c51d85617c9679161820 Mon Sep 17 00:00:00 2001 From: Dominik Schubert Date: Thu, 1 Feb 2024 20:01:57 +0100 Subject: [PATCH] fix make test target & add CI --- .github/workflows/build.yml | 40 +++++++++++++++++++++++++++++++++++++ Makefile | 2 +- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..e38d5d5 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,40 @@ +name: CI + +on: + push: + paths-ignore: + - 'README.md' + branches: + - main + pull_request: + branches: + - main + +jobs: + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: [ "3.10", "3.11", "3.12" ] + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up Python + id: setup-python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Run install + run: | + make install + + - name: Run linting + run: | + make lint + + - name: Run tests + run: | + make test diff --git a/Makefile b/Makefile index e973ca0..f2dc407 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ lint: $(VENV_RUN); python -m ruff check --show-source . && python -m black --check . test: venv - $(VENV_RUN); python -m pytest --cov $(ROOT_MODULE) + $(VENV_RUN); python -m pytest tests test-coverage: venv $(VENV_RUN); coverage run --source=$(ROOT_MODULE) -m pytest tests && coverage lcov -o .coverage.lcov