From 04107db55a2f4baac10ce43a8bfd233ece8764d3 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 | 36 ++++++++++++++++++++++++++++++++++++ Makefile | 10 ++++++++++ 2 files changed, 46 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..1dbc0a3 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,36 @@ +# 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 setup-ci + + - name: Test with pytest + run: | + make test diff --git a/Makefile b/Makefile index c59d340..3d5b9a8 100644 --- a/Makefile +++ b/Makefile @@ -7,3 +7,13 @@ setup: .PHONY: test test: pytest --cov=web_watchr --cov-report term-missing + +.PHONY: setup-ci +setup-ci: + pip install --upgrade pip + pip install uv + pwd + uv venv env + pwd + source env/bin/activate + uv pip install -e ".[dev]"