From f826dc09d25d25058b1bf9100a9977a8e52f2f1d Mon Sep 17 00:00:00 2001 From: ahmedgamalyousef Date: Wed, 1 Oct 2025 20:34:01 +0300 Subject: [PATCH] Adding CI Workflow --- .github/workflows/ci.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 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..5b5d602 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,35 @@ +name: CI - Fruit API + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build-and-test: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + 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 -r requirements.txt + + - name: Run API in background + run: | + nohup python fruit_api.py & + sleep 5 + + - name: Run API tests + run: | + chmod +x test_api.sh + ./test_api.sh