Skip to content

Updated github actions for testing #39

Updated github actions for testing

Updated github actions for testing #39

Workflow file for this run

name: Cypress Tests
on:
push:
branches: ['main']
pull_request:
branches: ['main']
jobs:
cypress-run-e2e:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
steps:
- name: Git Checkout Repo
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install Backend Modules
uses: cypress-io/github-action@v6
with:
install-command: npm run install:backend
runTests: false
- name: Install Frontend modules
uses: cypress-io/github-action@v6
with:
install-command: npm run install:frontend
runTests: false
- name: 'Prettier Format'
run: npm run prettier
- name: Run E2E tests 🧪
env:
API_SECRET: ${{secrets.API_SECRET}}
CLOUDINARY_API_KEY: ${{secrets.CLOUDINARY_API_KEY}}
CLOUD_NAME: ${{secrets.CLOUD_NAME}}
JWT_SECRET: ${{secrets.JWT_SECRET}}
MONGO_URI: ${{secrets.MONGO_URI}}
PAGINATION_LIMIT: ${{secrets.PAGINATION_LIMIT}}
PAYPAL_CLIENT_ID: ${{secrets.PAYPAL_CLIENT_ID}}
uses: cypress-io/github-action@v6
with:
start: npm start, npm run client
command: npm run test
frontend-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Frontend modules
uses: cypress-io/github-action@v6
with:
install-command: npm run install:frontend
runTests: false
- name: Run Frontend UI tests 🧪
# uses: cypress-io/github-action@v6
# with:
uses: ../frontend/
with:
# start: npm run start:frontend
# command: npm run test:frontend
working-directory: src
component: true
#
# steps:
# - uses: actions/checkout@v3
# - name: Install frontend modules
# run: npm run install:frontend
# - name: Run frontend unit tests 🧪
# run: npm run test:frontend:unit