Skip to content

nunombispo/github-actions-article

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

github-actions-article

A tiny Python example project used to demonstrate a GitHub Actions CI workflow.

If this script was useful to you, consider donating to support the Developer Service Blog: https://buy.stripe.com/bIYdTrggi5lZamkdQW

What’s in here

  • calculator.py: a minimal add(a, b) function.
  • test_calculator.py: a pytest unit test for add.
  • .github/workflows/ci.yml: CI that runs on pushes/PRs to main and executes:
    • ruff check .
    • mypy .
    • pytest across Python 3.10, 3.11, and 3.12.

Requirements

  • Python 3.10+

Setup

python -m venv .venv

Activate the virtual environment:

  • Windows (PowerShell):
.\.venv\Scripts\Activate.ps1
  • macOS/Linux (bash/zsh):
source .venv/bin/activate

Install dependencies:

pip install -r requirements.txt

Run locally

Run tests:

pytest

Run lint:

ruff check .

Run type-checking:

mypy .

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages