From 80281a34258e45d4e2b414d80524e3930849dc46 Mon Sep 17 00:00:00 2001 From: Oliver Zott Date: Thu, 26 Jun 2025 12:07:07 +0200 Subject: [PATCH 1/3] pipeline test --- setup.py | 2 +- src/velosaurus_calc/calculator.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 562d544..5f46929 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setup( name="velosaurus_calc", - version="1.0.7", + version="1.0.9", description="Most awesome math package ever.", long_description=long_description, long_description_content_type="text/markdown", diff --git a/src/velosaurus_calc/calculator.py b/src/velosaurus_calc/calculator.py index d47ac97..e2ecf5c 100644 --- a/src/velosaurus_calc/calculator.py +++ b/src/velosaurus_calc/calculator.py @@ -1,10 +1,11 @@ def add_floats(a: float, b: float) -> float: - return a + b + res = a - b + return res def subtract_floats(a: float, b: float) -> float: - return a + b + return a - b if __name__ == "__main__": - print(sum(2, 4)) + print(add_floats(2, 4)) From 9472aa22c3cba87fc9d59ebaf548a19292b6d9b5 Mon Sep 17 00:00:00 2001 From: Oliver Zott Date: Thu, 26 Jun 2025 12:21:53 +0200 Subject: [PATCH 2/3] pipeline test - fix --- README.md | 49 +++++++++++++++++++++++++++++++ src/velosaurus_calc/calculator.py | 2 +- 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 89e70ee..445b8c9 100644 --- a/README.md +++ b/README.md @@ -64,3 +64,52 @@ Use Ruff instead of flake8 (linter), black (formatter) and isort (import sorter) - **mypy** (static type annotations) - `mypy --exclude venv .` + +## Pipelines (Workflows) + +- The overall automation process, defined in a YAML file, that runs on certain triggers (like push, pull request, etc.). +- e.g. `python-linting.yml` file defines a pipeline (workflow). + +### Hierarchy in Github + +**In GitHub Actions, there are no native "stages"** like in Azure DevOps or GitLab CI. +The highest hierarchy in a workflow is: + +- **Workflow** (the whole YAML file, sometimes called a pipeline) + - **Jobs** (can run in parallel or in sequence using `needs`) + - **Steps** (run sequentially within a job) + +If you want to mimic "stages," you use multiple jobs and control their order with the `needs:` keyword. But officially, **jobs** are the top-level execution units inside a workflow. + +### **Runner** + +- **Definition:** A server (virtual machine or container) that executes your workflow jobs. +- **Example:** `runs-on: ubuntu-latest` tells GitHub to use an Ubuntu runner. + +--- + +### **Job** + +- **Definition:** + - A set of steps that run sequentially on the same runner. + - Multiple jobs in one pipeline (workflow) can run in parallel (unless you specify dependencies between them). + - Each job can specify its own runner using the runs-on key. + - By default, jobs run on separate runners (virtual machines or containers), which allows them to run in parallel and in isolated environments. +- **Example:** Your `lint` job runs all the steps (checkout, setup Python, install, test, lint). + +--- + +### **Action** + +- **Definition:** A reusable unit of code that performs a specific task in a workflow step. +- **Example:** `actions/checkout@v2` is an action that checks out your code. + +--- + +| Term | GitHub Actions Example | Description | +|----------|-------------------------------|-----------------------------------------------| +| Runner | `runs-on: ubuntu-latest` | Where jobs run | +| Action | `actions/checkout@v2` | Reusable step/task | +| Pipeline | `.github/workflows/*.yml` | The whole workflow process | +| Stage | (Not native, use jobs) | Logical phase (build/test/deploy) | +| Job | `jobs: lint:` | Group of steps on one runner | diff --git a/src/velosaurus_calc/calculator.py b/src/velosaurus_calc/calculator.py index e2ecf5c..eaac759 100644 --- a/src/velosaurus_calc/calculator.py +++ b/src/velosaurus_calc/calculator.py @@ -1,5 +1,5 @@ def add_floats(a: float, b: float) -> float: - res = a - b + res = a + b return res From d50530aa5ee6acaffc3bfbc0b079a7f0fbae1958 Mon Sep 17 00:00:00 2001 From: Oliver Zott Date: Thu, 26 Jun 2025 12:42:31 +0200 Subject: [PATCH 3/3] pipeline test - fix bump2version --- .bumpversion.cfg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 830cede..357ed61 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,6 +1,6 @@ [bumpversion] -current_version = 1.0.7 -commit = False -tag = False +current_version = 1.0.9 +commit = True +tag = True [bumpversion:file:setup.py] \ No newline at end of file