Skip to content

Commit

Permalink
ci: add github ci
Browse files Browse the repository at this point in the history
  • Loading branch information
HaydenOrz committed Aug 9, 2024
1 parent 28afa37 commit 9da4073
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 3 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
check:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/[email protected]
with:
version: 9.7.0

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run prettier check
run: pnpm prettier-check

- name: Run tsc check
run: pnpm check-types

build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/[email protected]
with:
version: 9.7.0

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run Build
run: pnpm build
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ package-lock.json
.parcel-cache
.vscode
example
*.tgz
*.tgz
.DS_Store
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"watch": "rm -rf lib && tsc --watch",
"release": "npm run build && node ./scripts/release.js",
"check-types": "tsc --noEmit --skipLibCheck",
"lint": "prettier --check './src/**/*.{js,jsx,tsx,ts,less}'",
"lint-fix": "prettier --write './src/**/*.{js,jsx,tsx,ts,less}'"
"format": "prettier --check './src/**/*.{js,jsx,tsx,ts,less}'",
"prettier-check": "prettier --write './src/**/*.{js,jsx,tsx,ts,less}'"
},
"publishConfig": {
"registry": "https://registry.npmjs.org/"
Expand Down

0 comments on commit 9da4073

Please sign in to comment.