Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding yml tests #4

Merged
merged 6 commits into from
Jan 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
version: 2.1

orbs:
cypress: cypress-io/[email protected]

jobs:
start-server:
docker:
- image: cypress/base:latest
steps:
- checkout
- run:
name: Install dependencies
command: npm install
- run:
name: Build the app
command: npm run build
deploy-to-render-staging:
docker:
- image: cimg/base:current
steps:
- run:
name: Deploy to Render Staging
command: |
echo "Deploying to Render Staging"
curl $RENDER_STAGING_DEPLOYHOOK
deploy-to-render-production:
docker:
- image: cimg/base:current
steps:
- run:
name: Deploy to Render Production
command: |
echo "Deploying to Render production"
curl $RENDER_PRODUCTION_DEPLOYHOOK

workflows:
run-tests-and-deploy-to-staging-then-production:
jobs:
- start-server
- cypress/run:
name: run-component-tests
cypress-command: npx cypress run --component
- deploy-to-render-staging:
requires:
- run-component-tests
filters:
branches:
only: main
- deploy-to-render-production:
requires:
- deploy-to-render-staging
filters:
branches:
only: main
30 changes: 30 additions & 0 deletions .github/workflows/checking_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Cypress Checking Tests

on:
pull_request:
branches:
- develop
- staging

jobs:
test:
name: Cypress Checking Tests
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 21.x

- name: Install dependencies
run: npm install

- name: Build App
run: npm run build

- name: Run Cypress tests
run: npm run test-component
27 changes: 27 additions & 0 deletions .github/workflows/deploy_to_render.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Cypress Test Deploy To Render

on:
push:
branches: [main]
pull_request:
branches:
- main

jobs:
ci:
name: Cypress Test Deploy To Render
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Test
run: |
npm install
npm run test

- name: Deploy
# Only run this step if the branch is main
if: github.ref == 'refs/heads/main'
env:
deploy_url: ${{ secrets.RENDER_DEPLOY_HOOK_URL }}
run: |
curl "$deploy_url"
Loading