From 7a17e1581162d1026e4665228990836767623975 Mon Sep 17 00:00:00 2001 From: ARAFAT OLAYIWOLA Date: Mon, 1 Jul 2024 21:51:54 +0100 Subject: [PATCH] add ci pipeline yml --- .github/workflows/ci.yml | 44 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 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..82c641c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,44 @@ +name: CI Pipeline + +on: + push: + branches: [ "main", "development" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + max-parallel: 4 + matrix: + python-version: [3.8, 3.9] + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + + - name: Create .env file + run: | + + echo "SECRET_KEY=qp6_snqe9&ztum3lju!pj8%aau&xgm@coid4px5bvhi65w0&s$" >> .env + + echo "DEBUG=True" >> .env + + + - name: Install Dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Run Tests + run: | + # Export environment variables safely using envsubst + export $(grep -v '^#' .env | xargs -d '\n') + pytest + env: + ENV_FILE_PATH: .env