Skip to content

Commit

Permalink
chore: πŸ’‚β€β™‚οΈ create test CI (#2)
Browse files Browse the repository at this point in the history
* chore: πŸ’‚β€β™‚οΈ update tsconfig and package.json

* chore: πŸ’‚β€β™‚οΈ add test CI
  • Loading branch information
BartekCK committed Jan 20, 2023
1 parent c21cac4 commit 1e26707
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 1 deletion.
51 changes: 51 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: App testing

on:
push:
branches: [ "develop", "master" ]
pull_request:
branches: [ "develop", "master" ]

jobs:
test:

services:
postgres:
image: postgres
ports:
- "5432:5432"
env:
POSTGRES_USER: user123
POSTGRES_PASSWORD: root
POSTGRES_DB: test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

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 all dependencies
run: npm ci

- name: Check typescript types
run: npm run check-types

- name: Check lint
run: npm run lint

- name: Run test
run: npm test
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"scripts": {
"dev": "echo \"Error: no test specified\" && exit 1",
"build": "rimraf ./dist && tsc",
"lint": "eslint \"src/**/*.ts\" --fix --quiet",
"check-types": "tsc --noEmit",
"pretest": "NODE_ENV=test npm run migrations:latest",
"test": "NODE_ENV=test jest --runInBand",
"posttest": "NODE_ENV=test npm run migrations:rollback:all",
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,6 @@
"skipLibCheck": true, /* Skip type checking of declaration files. */
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
},
"exclude": ["node_modules", "dist"],
"exclude": ["node_modules", "dist", "**/__tests__", "**/migrations"],
"include": ["src"]
}

0 comments on commit 1e26707

Please sign in to comment.