From b2c328d8adb0fd886bcc00162da27d0b0e608164 Mon Sep 17 00:00:00 2001 From: Dusan Haustein Date: Thu, 6 Mar 2025 12:01:43 +0100 Subject: [PATCH 1/6] ci: add github checks --- .github/workflows/ci.yml | 48 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 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..7dd3f58 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,48 @@ +name: HTTP Protocol Testing CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up the Python environment + uses: actions/setup-python@v4 + with: + python-version: '3.10' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install uv + uv sync + - name: Lint with ruff + run: | + ruff check + - name: Type check with mypy + run: | + mypy . + + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install uv + uv sync + - name: Run unit tests + run: | + pytest tests/unit/ --cov=. --cov-report=xml + - name: Run integration tests + run: | + pytest tests/integration/ --cov=. --cov-report=xml --cov-append From 0a84a21fe162b98b5a53218366416fc6243a181d Mon Sep 17 00:00:00 2001 From: Dusan Haustein Date: Thu, 6 Mar 2025 12:09:28 +0100 Subject: [PATCH 2/6] ci: make sure uv uses system wide python --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7dd3f58..739902b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: run: | python -m pip install --upgrade pip pip install uv - uv sync + uv --system sync - name: Lint with ruff run: | ruff check @@ -39,7 +39,7 @@ jobs: run: | python -m pip install --upgrade pip pip install uv - uv sync + uv --system sync - name: Run unit tests run: | pytest tests/unit/ --cov=. --cov-report=xml From d32f5c36ab1bed1961034f92c2a195f501a07733 Mon Sep 17 00:00:00 2001 From: Dusan Haustein Date: Thu, 6 Mar 2025 12:35:36 +0100 Subject: [PATCH 3/6] ci: switch to uv from astral directly --- .github/workflows/ci.yml | 65 +++++++++++++++++++++++++--------------- 1 file changed, 41 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 739902b..c40232c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,40 +9,57 @@ on: jobs: lint: runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v3 - - name: Set up the Python environment - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + + - name: "Install uv" + uses: astral-sh/setup-uv@v5 + with: + enable-cache: true + cache-dependency-glob: "uv.lock" + + - name: "Set up Python" + uses: actions/setup-python@v5 with: - python-version: '3.10' - - name: Install dependencies + python-version-file: ".python-version" + + - name: "Install dependencies" run: | - python -m pip install --upgrade pip - pip install uv - uv --system sync - - name: Lint with ruff + uv sync --all-extras --dev + + - name: "Lint with ruff" run: | - ruff check - - name: Type check with mypy + uv run ruff + + - name: "Type check with mypy" run: | - mypy . + uv run mypy . test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + + - name: "Install uv" + uses: astral-sh/setup-uv@v5 + with: + enable-cache: true + cache-dependency-glob: "uv.lock" + + - name: "Set up Python" + uses: actions/setup-python@v5 with: - python-version: '3.10' - - name: Install dependencies + python-version-file: ".python-version" + + - name: "Install dependencies" run: | - python -m pip install --upgrade pip - pip install uv - uv --system sync - - name: Run unit tests + uv sync --all-extras --dev + + - name: "Run unit tests" run: | - pytest tests/unit/ --cov=. --cov-report=xml - - name: Run integration tests + uv run pytest tests/unit/ --cov=. --cov-report=xml + + - name: "Run integration tests" run: | - pytest tests/integration/ --cov=. --cov-report=xml --cov-append + uv run pytest tests/integration/ --cov=. --cov-report=xml --cov-append From 5a41763dbef7aadd08e45983e368fc78b1a95895 Mon Sep 17 00:00:00 2001 From: Dusan Haustein Date: Thu, 6 Mar 2025 12:37:38 +0100 Subject: [PATCH 4/6] ci: remove code cov for now --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c40232c..fbd7f5a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,8 +58,8 @@ jobs: - name: "Run unit tests" run: | - uv run pytest tests/unit/ --cov=. --cov-report=xml + uv run pytest tests/unit/ - name: "Run integration tests" run: | - uv run pytest tests/integration/ --cov=. --cov-report=xml --cov-append + uv run pytest tests/integration/ From 5f708f1fc8cea7c8ff8b7a2a2702f7c788a9d1e9 Mon Sep 17 00:00:00 2001 From: Dusan Haustein Date: Thu, 6 Mar 2025 12:40:31 +0100 Subject: [PATCH 5/6] fix: ruff call missing option --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fbd7f5a..95d03ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,7 +30,7 @@ jobs: - name: "Lint with ruff" run: | - uv run ruff + uv run ruff check - name: "Type check with mypy" run: | From a64b49d45632933618094868206c119a2cc25833 Mon Sep 17 00:00:00 2001 From: Dusan Haustein Date: Thu, 6 Mar 2025 12:45:33 +0100 Subject: [PATCH 6/6] ci: more verbosity --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 95d03ca..97752e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,11 +30,11 @@ jobs: - name: "Lint with ruff" run: | - uv run ruff check + uv run ruff check -v - name: "Type check with mypy" run: | - uv run mypy . + uv run mypy . -v test: runs-on: ubuntu-latest