Skip to content

Commit 3dfced6

Browse files
authored
Merge pull request #157 from jorgebodega/github-ci-1
CI: Create pull-request.yml
2 parents b97290c + ce09783 commit 3dfced6

File tree

2 files changed

+44
-9
lines changed

2 files changed

+44
-9
lines changed

.github/workflows/pull-request.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Pull request checks
2+
3+
on:
4+
pull_request:
5+
branches: [ master ]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
node_version:
13+
- lts/erbium
14+
- lts/fermium
15+
name: Node ${{ matrix.node_version }}
16+
steps:
17+
- name: Check out repository code
18+
uses: actions/checkout@v2
19+
- name: Setup node
20+
uses: actions/setup-node@v2
21+
with:
22+
node-version: ${{ matrix.node_version }}
23+
cache: yarn
24+
- name: Install dependencies
25+
run: yarn install --frozen-lockfile
26+
- name: Format check
27+
run: yarn format:ci
28+
- name: Linter
29+
run: yarn lint:ci
30+
- name: Typecheck
31+
run: yarn typecheck
32+
- name: Jest
33+
run: yarn test

package.json

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,22 @@
1414
"url": "https://github.com/w3tecch/typeorm-seeding.git"
1515
},
1616
"scripts": {
17-
"prebuild": "rimraf dist",
17+
"build": "tsc --project ./tsconfig.build.json",
1818
"format": "prettier --write \"src/**/*.ts\"",
19-
"lint": "eslint \"src/**/*.ts\" --fix",
20-
"build": "npm run prebuild && tsc --project ./tsconfig.build.json",
21-
"watch": "rollup -cw",
22-
"test": "jest",
23-
"test:watch": "jest --watch",
24-
"test:cov": "jest --coverage",
19+
"format:ci": "prettier --check \"src/**/*.ts\" \"sample/**/*.ts\"",
20+
"lint": "eslint \"src/**/*.ts\" \"sample/**/*.ts\" --fix",
21+
"lint:ci": "eslint \"src/**/*.ts\" \"sample/**/*.ts\"",
22+
"prebuild": "rimraf dist",
2523
"semantic-release": "semantic-release",
2624
"schema:drop": "ts-node ./node_modules/typeorm/cli.js schema:drop -c sample",
27-
"schema:sync": "ts-node ./node_modules/typeorm/cli.js schema:sync -c sample",
2825
"schema:log": "ts-node ./node_modules/typeorm/cli.js schema:log -c sample",
26+
"schema:sync": "ts-node ./node_modules/typeorm/cli.js schema:sync -c sample",
2927
"seed:run": "ts-node ./dist/cli.js seed -c sample",
30-
"seed:config": "ts-node ./dist/cli.js config -c sample"
28+
"seed:config": "ts-node ./dist/cli.js config -c sample",
29+
"test": "jest",
30+
"test:cov": "jest --coverage",
31+
"test:watch": "jest --watch",
32+
"typecheck": "tsc --noEmit"
3133
},
3234
"devDependencies": {
3335
"@semantic-release/git": "^9.0.0",

0 commit comments

Comments
 (0)