Skip to content

Commit

Permalink
ci: auto check code quality when push and pr
Browse files Browse the repository at this point in the history
  • Loading branch information
northword committed Oct 30, 2024
1 parent 1b26cf5 commit 70bf3e0
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
45 changes: 45 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Check

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
release-it:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GitHub_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup pnpm
uses: pnpm/action-setup@v2

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install deps
run: |
echo "public-hoist-pattern[]=@types*" >> .npmrc
pnpm install
- name: Run Lint
run: |
pnpm lint
- name: Run Build
run: |
pnpm build
- name: Run Test
run: |
pnpm test
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"scripts": {
"start": "zotero-plugin serve",
"build": "tsc --noEmit && zotero-plugin build",
"lint": "eslint . --fix",
"lint:check": "eslint .",
"lint:fix": "eslint . --fix",
"update-data": "bash src/data/update-data.sh",
"test": "vitest",
"release": "zotero-plugin release",
Expand Down

0 comments on commit 70bf3e0

Please sign in to comment.