Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Github action for build and lint #470

Merged
merged 3 commits into from
Feb 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading