Skip to content
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
12 changes: 12 additions & 0 deletions .github/workflows/create_PR_from_feature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,15 @@ jobs:
if: always()
with:
comment_title: "Tests Results"

lint:
runs-on: ubuntu-latest
needs: pr-to-test
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm run lint
31 changes: 31 additions & 0 deletions .github/workflows/deploy_to_production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Deploy a produccion

on: [workflow_dispatch]

jobs:
merge-and-deploy-to-production:
runs-on: ubuntu-latest
steps:
- name: Merge test -> main
uses: devmasx/merge-branch@master
with:
type: now
from_branch: test
target_branch: main
github_token: ${{ github.token }}

- uses: actions/checkout@v3

- name: Build, Push and Release a Docker container to Heroku.
uses: gonuit/heroku-docker-deploy@v1.3.3
with:
email: ${{ secrets.HEROKU_EMAIL }}
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
heroku_app_name: ${{ secrets.HEROKU_APP_NAME_MAIN }}

- uses: HiromiShikata/gh-actions-move-all-cards-on-projects@v1.0.1
with:
project_name: Features
from_column_name: Desplegado en Testing
to_column_name: Desplegado en Produccion
github_token: ${{ secrets.GHTOKEN }}
24 changes: 0 additions & 24 deletions .github/workflows/deploy_to_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,6 @@ jobs:

steps:
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- run: npm ci
- run: npm run build --if-present

- name: Build, Push and Release a Docker container to Heroku.
uses: gonuit/heroku-docker-deploy@v1.3.3
Expand All @@ -39,18 +30,3 @@ jobs:
apiKey: ${{ secrets.POSTMAN_API_KEY }}
collection: ${{ secrets.POSTMAN_COLLECTION }}
environment: ${{ secrets.POSTMAN_ENVIRONMENT }}

- name: Merge test -> main
uses: devmasx/merge-branch@master
with:
type: now
from_branch: test
target_branch: main
github_token: ${{ github.token }}

- uses: HiromiShikata/gh-actions-move-all-cards-on-projects@v1.0.1
with:
project_name: Features
from_column_name: Desplegado en Testing
to_column_name: Desplegado en Produccion
github_token: ${{ secrets.GHTOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,4 @@ dist

# TernJS port file
.tern-port
junit.xml
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run lint:fix
23 changes: 23 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"start": "node dist/index.js",
"lint": "eslint --ext ts,tsx .",
"lint:fix": "eslint --ext ts,tsx . --fix",
"test": "jest --reporters='default' --reporters='jest-junit'"
"test": "jest --reporters='default' --reporters='jest-junit'",
"prepare": "husky install"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -39,6 +40,7 @@
"@types/node": "^17.0.25",
"@typescript-eslint/eslint-plugin": "^5.21.0",
"@typescript-eslint/parser": "^5.21.0",
"husky": "^8.0.1",
"jest": "^28.1.0",
"jest-junit": "^13.2.0",
"nodemon": "^2.0.16",
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const port = process.env.PORT || 4000;

app.get('/', (_req, res) => {
res.send('Hello World!!!!!!!!!!');

});

db.connectDB();
Expand Down
1 change: 1 addition & 0 deletions tests/UserController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ describe('test add function', () => {
it('should start with four users', async () => {
const response = await request(app).get('/users');
expect(response.body.users).toHaveLength(4);

});
});