From ee500ebccd8d6f00a92334ceed84352f1e9511dc Mon Sep 17 00:00:00 2001 From: Maksim Date: Fri, 5 Dec 2025 21:05:37 +0700 Subject: [PATCH] add ci --- .gitea/workflows/test.yml | 25 +++++++++++++++++++++++++ app.py | 2 ++ requirements.txt | 1 + test_app.py | 5 +++++ 4 files changed, 33 insertions(+) create mode 100644 .gitea/workflows/test.yml create mode 100644 app.py create mode 100644 requirements.txt create mode 100644 test_app.py diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml new file mode 100644 index 0000000..5460f76 --- /dev/null +++ b/.gitea/workflows/test.yml @@ -0,0 +1,25 @@ +name: Python CI + +on: + push: + branches: + - main + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.11 + + - name: Install Dependencies + run: pip install -r requirements.txt + + - name: Run Tests + run: pytest + diff --git a/app.py b/app.py new file mode 100644 index 0000000..4693ad3 --- /dev/null +++ b/app.py @@ -0,0 +1,2 @@ +def add(a, b): + return a + b diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..e079f8a --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +pytest diff --git a/test_app.py b/test_app.py new file mode 100644 index 0000000..b08c32d --- /dev/null +++ b/test_app.py @@ -0,0 +1,5 @@ +from app import add + +def test_add(): + assert add(2, 3) == 5 +