Skip to content

Commit

Permalink
feat: workflow for running test when a new pull req is created on dev…
Browse files Browse the repository at this point in the history
…elop
  • Loading branch information
Ashok authored and Ashok committed Mar 20, 2024
1 parent 1240882 commit 3b11b34
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
37 changes: 37 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Run tests

on:
pull_request:
branches: [ develop ]

jobs:

test:
name: Test
runs-on: ubuntu-latest

services:
postgres:
image: postgres:14-alpine
env:
POSTGRES_USER: root
POSTGRES_PASSWORD: secret
POSTGRES_DB: eth
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
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
- run: npm run test:cover
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json",
"test:int": "jest -i --no-cache --watch --config jest-int.json",
"migrate": "npx sequelize-cli db:migrate --migrations-path=src/migrations"
"migrate": "npx sequelize-cli db:migrate --migrations-path=src/migrations",
"test:cover": "jest -i --no-cache --config jest-int.json"
},
"dependencies": {
"@nestjs/common": "^10.3.4",
Expand Down

0 comments on commit 3b11b34

Please sign in to comment.