diff --git a/.github/workflows/backend_CI.yml b/.github/workflows/backend_CI.yml new file mode 100644 index 00000000..3a3e13af --- /dev/null +++ b/.github/workflows/backend_CI.yml @@ -0,0 +1,39 @@ +name: SpeechBuddy Backend CI + +on: + push: + branches: [ "main", "feat/CICD-backend" ] + 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: Install Dependencies + run: | + cd backend + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Run Tests + run: | + cd backend + python manage.py test --no-input + env: + SECRET_KEY: ${{ secrets.SECRET_KEY }} + EMAIL_HOST_USER: ${{ secrets.EMAIL_HOST_USER }} + EMAIL_HOST_PASSWORD: ${{ secrets.EMAIL_HOST_PASSWORD }}