Skip to content

Commit

Permalink
feat: add coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
saisilinus committed Apr 18, 2022
1 parent 86a9fbe commit ea05317
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 18 deletions.
40 changes: 22 additions & 18 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,30 @@ env:
JWT_VERIFY_EMAIL_EXPIRATION_MINUTES: 10

jobs:
build:
run-linting-tests:
uses: ./.github/workflows/setUp.yml
steps:
- run: yarn lint

run-unit-tests:
uses: ./.github/workflows/setUp.yml
steps:
- run: yarn lint

runs-on: ubuntu-latest
generate-coverage:

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

uses: ./.github/workflows/setUp.yml
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.3.0
- run: yarn coverage:coveralls

send-coverage-to-coveralls.io:

needs: build

steps:
- name: Publish to coveralls.io
uses: coverallsapp/github-action@v1.1.2
with:
mongodb-version: ${{ matrix.mongodb-version }}
- run: yarn
- run: yarn lint
- run: yarn test
github-token: ${{ github.token }}
36 changes: 36 additions & 0 deletions .github/workflows/setUp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Set up Node.js and MongoDB

on:
workflow_call:

env:
PORT: 3000
MONGODB_URL: mongodb://127.0.0.1:27017/node-ts-boilerplate
JWT_SECRET: thisisasamplesecret
JWT_ACCESS_EXPIRATION_MINUTES: 30
JWT_REFRESH_EXPIRATION_DAYS: 30
JWT_RESET_PASSWORD_EXPIRATION_MINUTES: 10
JWT_VERIFY_EMAIL_EXPIRATION_MINUTES: 10

jobs:
build:

runs-on: ubuntu-latest

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

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.3.0
with:
mongodb-version: ${{ matrix.mongodb-version }}
- run: yarn

0 comments on commit ea05317

Please sign in to comment.