Skip to content

Commit

Permalink
Merge pull request #4 from mairess/config-ci-github-actions
Browse files Browse the repository at this point in the history
Config ci GitHub actions
  • Loading branch information
mairess authored Apr 24, 2024
2 parents 80c4982 + c2f147c commit d6792a6
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 4 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI

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

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

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'
- name: Install dependencies and run tests
run: |
cd backend
npm ci
npm run test:coverage
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: backend/coverage/coverage-summary.json
slug: mairess/project-store-manager
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

<div align="center">

| Statements | Branches | Functions | Lines |
| --------------------------- | ----------------------- | ------------------------- | -------------------- |
| ![Statements](https://img.shields.io/badge/Coverage-100%25-brightgreen.svg) | ![Branches](https://img.shields.io/badge/Coverage-100%25-brightgreen.svg) | ![Functions](https://img.shields.io/badge/Coverage-100%25-brightgreen.svg) | ![Lines](https://img.shields.io/badge/Coverage-100%25-brightgreen.svg) |
<a href="https://codecov.io/gh/mairess/project-store-manager" >
<img src="https://codecov.io/gh/mairess/project-store-manager/graph/badge.svg?token=0E5II8VC4C"/>
</a>

</div>

Expand Down
30 changes: 30 additions & 0 deletions __tests__/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "sd-0x-store-manager-tests",
"version": "1.0.0",
"description": "Projeto Store Manager - Testes",
"author": "Trybe",
"license": "ISC",
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
},
"scripts": {
"cy": "cypress run",
"cy:open": "cypress open --e2e --browser electron",
"lint": "eslint --no-error-on-unmatched-pattern .",
"test": "CY_CLI=true cypress run -r spec -s \"**/*$REQ*\""
},
"devDependencies": {
"@stryker-mutator/core": "6.4.2",
"@stryker-mutator/mocha-runner": "6.4.2",
"@testing-library/cypress": "9.0.0",
"cypress": "12.6.0",
"cypress-multi-reporters": "1.6.3",
"eslint-config-trybe-backend": "2.1.0",
"eslint-plugin-cypress": "^2.13.2",
"mochawesome": "7.1.3",
"mochawesome-merge": "4.3.0",
"mochawesome-report-generator": "6.2.0",
"mysql2": "2.3.0"
}
}
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"start": "node .",
"dev": "nodemon --inspect=0.0.0.0:9229 .",
"test:mocha": "mocha",
"test:coverage": "nyc mocha",
"test:coverage": "nyc --report-dir=./coverage mocha",
"test:mutation": "stryker run",
"lint": "eslint --no-error-on-unmatched-pattern ."
},
Expand Down

0 comments on commit d6792a6

Please sign in to comment.