Skip to content

Commit

Permalink
github action for build, lint and format (#470)
Browse files Browse the repository at this point in the history
* action for build and lint

* fix things

* format check
  • Loading branch information
sidmohanty11 authored Feb 17, 2024
1 parent 2931bfd commit 170b2db
Show file tree
Hide file tree
Showing 79 changed files with 1,015 additions and 844 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/build-and-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build and Lint

on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]

jobs:
build-and-lint:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 16.19.0

- name: Set up Yarn
uses: actions/setup-node@v3
with:
node-version: 16.19.0
cache: 'yarn'

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn

- name: Format check
run: yarn format:check

- name: Lint check
run: yarn lint

- name: Build
run: yarn build && yarn build:storybook
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
"scripts": {
"preinstall": "node scripts/node-check.js",
"postinstall": "yarn build",
"build": "lerna run build"
"build": "lerna run build",
"lint": "lerna run lint",
"build:storybook": "lerna run build-storybook",
"format": "lerna run format",
"format:check": "lerna run format:check"
},
"devDependencies": {
"@changesets/cli": "^2.26.2",
Expand Down
4 changes: 3 additions & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "rollup -c",
"dev": "yarn parcel playground/index.html"
"dev": "yarn parcel playground/index.html",
"format": "prettier --write 'src/'",
"format:check": "prettier --check 'src/'"
},
"author": "",
"license": "ISC",
Expand Down
Loading

0 comments on commit 170b2db

Please sign in to comment.