Skip to content

Experimental feature #844

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

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
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
8 changes: 5 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ module.exports = {
"env": {
"browser": true,
"es6": true,
"jest/globals": true
"jest/globals": true,
"node" : true,
"cypress/globals": true,
},
"extends": [
"eslint:recommended",
Expand All @@ -16,15 +18,15 @@ module.exports = {
"sourceType": "module"
},
"plugins": [
"react", "jest"
"react", "jest", "cypress"
],
"rules": {
"indent": [
"error",
2
],
"linebreak-style": [
"error",
"off",
"unix"
],
"quotes": [
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/helloworld.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Hello World!

on:
push:
branches:
- master
# note that your "main" branch might be called main instead of master

jobs:
hello_world_job:
runs-on: ubuntu-20.04
steps:
- name: Say hello
run: |
echo "Hello World!"
- name : Print Date
run : |
date
- name : Directory Content
run : |
ls -l
new_job:
runs-on: ubuntu-20.04
steps :
- name : New Test
run : echo "hello world"


51 changes: 51 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Deployment Pipeline

on:
push:
branches:
- master

pull_request:
branches: [master]
types: [opened,closed,synchronize]

jobs:
Simple-Deployment-Pipeline :
runs-on : ubuntu-20.04
steps :
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "16"
- name: Install dependencies
run: npm install
- name: Check Style
run: npm run eslint
- name: Test the application
run: npm run test
- name: Build the application
run: npm run build
TriggerDeploy :
if: (github.head_ref == 'master')
needs: [Simple-Deployment-Pipeline]
name: Deploy to Render
runs-on: ubuntu-latest
steps:
- name: Trigger deployment
run: curl https://api.render.com/deploy/srv-${{ secrets.RENDER_SERVICE_ID }}?key=${{ secrets.RENDER_API_KEY }}
TagRelease :
if: ( github.head_ref == 'master')
needs: [Simple-Deployment-Pipeline]
name: Tag a release
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name : Say Hello
run : echo "Hello Tag Release."
- name : Bump version and push tag
uses : anothrNick/github-tag-action@1.55.0
env :
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


17 changes: 10 additions & 7 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
const express = require("express");
const app = express();
const express = require('express')
const app = express()

// Heroku dynamically sets a port
const PORT = process.env.PORT || 5000;
const PORT = process.env.PORT || 5000

app.use(express.static('dist'))

app.listen(PORT,'0.0.0.0' , () => {
})



app.use(express.static("dist"));

app.listen(PORT, () => {
console.log("server started on port 5000");
});
5 changes: 5 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const { defineConfig } = require('cypress')

module.exports = defineConfig({

})
6 changes: 6 additions & 0 deletions cypress/e2e/e2e.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
describe('Note app', () => {
it('front page can be opened', function () {
cy.visit('http://localhost:5173')
cy.get('.list-item')
})
})
5 changes: 5 additions & 0 deletions cypress/fixtures/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "Using fixtures to represent data",
"email": "hello@cypress.io",
"body": "Fixtures are a great way to mock data for responses to routes"
}
25 changes: 25 additions & 0 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add('login', (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
20 changes: 20 additions & 0 deletions cypress/support/e2e.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// ***********************************************************
// This example support/e2e.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands'

// Alternatively you can use CommonJS syntax:
// require('./commands')
Loading