remove cypress test from ci/cd #43
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI/CD Pipeline | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Install backend dependencies | |
run: | | |
cd backend | |
pip install -r requirements.txt | |
- name: Run backend tests | |
env: | |
SECRET_KEY: ${{ secrets.DJANGO_TEST_SECRET }} | |
run: | | |
cd backend | |
python manage.py test --settings=rabbit_rescue_REST.settings_test | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Install frontend dependencies | |
run: | | |
cd frontend | |
npm install | |
- name: Run frontend unit/functional tests with Vitest | |
env: | |
VITE_STRIPE_LINK: ${{ secrets.VITE_STRIPE_LINK }} | |
run: | | |
cd frontend | |
npm run test | |
# - name: Start backend server for Cypress tests | |
# env: | |
# SECRET_KEY: ${{ secrets.DJANGO_TEST_SECRET }} | |
# DATABASE_URL: ${{ secrets.DATABASE_URL }} | |
# CLOUDINARY_URL: ${{ secrets.CLOUDINARY_URL }} | |
# FRONTEND_URL: ${{ secrets.FRONTEND_URL }} | |
# VITE_STRIPE_LINK: ${{ secrets.VITE_STRIPE_LINK }} | |
# run: | | |
# cd backend | |
# python manage.py collectstatic --noinput | |
# python manage.py runserver & | |
# - name: Run Cypress tests | |
# uses: cypress-io/github-action@v6 | |
# with: | |
# browser: chrome | |
# start: npm start | |
# working-directory: frontend | |
deploy: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Deploy to Heroku (backend) | |
uses: akhileshns/heroku-deploy@v3.13.15 # This action deploys to Heroku | |
with: | |
heroku_api_key: ${{secrets.HEROKU_API_KEY}} | |
heroku_app_name: ${{secrets.HEROKU_BACKEND_NAME}} | |
heroku_email: ${{secrets.HEROKU_EMAIL}} | |
appdir: "backend" | |
dontautocreate: true | |
- name: Deploy to Heroku (frontend) | |
uses: akhileshns/heroku-deploy@v3.13.15 # This action deploys to Heroku | |
with: | |
heroku_api_key: ${{secrets.HEROKU_API_KEY}} | |
heroku_app_name: ${{secrets.HEROKU_FRONTEND_NAME}} | |
heroku_email: ${{secrets.HEROKU_EMAIL}} | |
appdir: "frontend" | |
dontautocreate: true |