diff --git a/pytest b/pytest new file mode 100644 index 0000000000000..268b1d2d3b3cf --- /dev/null +++ b/pytest @@ -0,0 +1,35 @@ +name: CI Tests + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.10" + + - name: Install dependencies + run: | + pip install --upgrade pip + pip install -r requirements.txt + +Add CI workflow and project structure + + + + + + - name: Run tests + run: | + pytest -q diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000000..e079f8a6038dd --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +pytest diff --git a/src/main.py b/src/main.py new file mode 100644 index 0000000000000..c4501b8ab1243 --- /dev/null +++ b/src/main.py @@ -0,0 +1 @@ +def add(a, b):\n return a + b diff --git a/tests/test_main.py b/tests/test_main.py new file mode 100644 index 0000000000000..2b0694f2c0eb6 --- /dev/null +++ b/tests/test_main.py @@ -0,0 +1,6 @@ +tests/test_main.py +from src.main import add + +def test_add(): + assert add(2, 3) == 5 + assert add(-1, 1) == 0