mirror of
https://github.com/sasjs/server.git
synced 2025-12-10 11:24:35 +00:00
chore(workflow): add lint step
This commit is contained in:
46
.github/workflows/build.yml
vendored
46
.github/workflows/build.yml
vendored
@@ -5,6 +5,25 @@ on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [12.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- name: Install Dependencies
|
||||
run: npm ci
|
||||
- name: Check Api Code Style
|
||||
run: npm run lint-api
|
||||
- name: Check Web Code Style
|
||||
run: npm run lint-web
|
||||
build-api:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@@ -32,3 +51,30 @@ jobs:
|
||||
run: npm run build
|
||||
env:
|
||||
CI: true
|
||||
build-web:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [12.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- name: Install Dependencies
|
||||
working-directory: ./web
|
||||
run: npm ci
|
||||
- name: Check Code Style
|
||||
working-directory: ./web
|
||||
run: npm run lint
|
||||
- name: Run Unit Tests
|
||||
working-directory: ./web
|
||||
run: npm test
|
||||
- name: Build Package
|
||||
working-directory: ./web
|
||||
run: npm run build
|
||||
env:
|
||||
CI: true
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "server",
|
||||
"name": "api",
|
||||
"version": "0.0.1",
|
||||
"description": "SASjs server",
|
||||
"description": "Api of SASjs server",
|
||||
"main": "./src/server.ts",
|
||||
"scripts": {
|
||||
"start": "nodemon ./src/server.ts",
|
||||
@@ -9,9 +9,7 @@
|
||||
"build": "rimraf build && tsc",
|
||||
"semantic-release": "semantic-release -d",
|
||||
"prepare": "[ -d .git ] && git config core.hooksPath ./.git-hooks || true",
|
||||
"test": "mkdir -p tmp && jest --coverage",
|
||||
"lint:fix": "npx prettier --write \"src/**/*.{ts,tsx,js,jsx,html,css,sass,less,yml,md,graphql}\"",
|
||||
"lint": "npx prettier --check \"src/**/*.{ts,tsx,js,jsx,html,css,sass,less,yml,md,graphql}\""
|
||||
"test": "mkdir -p tmp && jest --coverage"
|
||||
},
|
||||
"release": {
|
||||
"branches": [
|
||||
@@ -32,7 +30,6 @@
|
||||
"@types/supertest": "^2.0.11",
|
||||
"jest": "^27.0.6",
|
||||
"nodemon": "^2.0.7",
|
||||
"prettier": "^2.3.1",
|
||||
"rimraf": "^3.0.2",
|
||||
"semantic-release": "^17.4.3",
|
||||
"supertest": "^6.1.3",
|
||||
|
||||
14
package.json
Normal file
14
package.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "server",
|
||||
"version": "0.0.1",
|
||||
"description": "NodeJS wrapper for calling the SAS binary executable",
|
||||
"scripts": {
|
||||
"lint-api:fix": "npx prettier --write \"api/src/**/*.{ts,tsx,js,jsx,html,css,sass,less,yml,md,graphql}\"",
|
||||
"lint-api": "npx prettier --check \"api/src/**/*.{ts,tsx,js,jsx,html,css,sass,less,yml,md,graphql}\"",
|
||||
"lint-web:fix": "npx prettier --write \"web/src/**/*.{ts,tsx,js,jsx,html,css,sass,less,yml,md,graphql}\"",
|
||||
"lint-web": "npx prettier --check \"web/src/**/*.{ts,tsx,js,jsx,html,css,sass,less,yml,md,graphql}\""
|
||||
},
|
||||
"devDependencies": {
|
||||
"prettier": "^2.3.1"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user