From 6514793a478458b6748fa397bda2a0c0668c731b Mon Sep 17 00:00:00 2001 From: Tim Adler Date: Sat, 7 Sep 2024 15:13:41 +0200 Subject: [PATCH] Create testing pipeline --- .github/workflows/ci.yml | 32 ++++++++++++++++++++++++++++++++ Makefile | 10 ++++++++++ 2 files changed, 42 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..2809f54 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,32 @@ +# This workflow will install Python dependencies, run tests with a variety of Python versions +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: Python package + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.10", "3.11", "3.12"] + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + make run-ci diff --git a/Makefile b/Makefile index c59d340..be9ca42 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +SHELL := /bin/bash + .PHONY: setup setup: pip install uv @@ -7,3 +9,11 @@ setup: .PHONY: test test: pytest --cov=web_watchr --cov-report term-missing + +.PHONY: setup-ci +run-ci: + pip install --upgrade pip + pip install uv + uv venv + uv pip install -e ".[dev]" + pytest --cov=web_watchr --cov-report term-missing