Skip to content

Commit

Permalink
ci: add lint and test workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
qmhc committed Jul 5, 2023
1 parent be43a4d commit 3eb335f
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 1 deletion.
66 changes: 66 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: CI

on:
push:
branches:
- main

pull_request:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

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

- name: Set node
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: pnpm

- name: Install deps
run: pnpm install

- name: Lint
run: pnpm run lint

test:
runs-on: ${{ matrix.os }}

strategy:
matrix:
node: [18.x]
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: false

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

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

- name: Set node ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: pnpm

- name: Install deps
run: pnpm install

- name: Test
run: pnpm run test
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"build": "tsx scripts/build.ts",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s --commit-path .",
"dev": "unbuild --stub",
"lint": "eslint --fix --ext .js,.jsx,.ts,.tsx,.vue \"{src,tests,examples}/**\"",
"lint": "eslint --ext .js,.jsx,.ts,.tsx \"{src,tests}/**\"",
"postinstall": "is-ci || husky install",
"postpublish": "pinst --enable",
"precommit": "lint-staged -c ./.husky/.lintstagedrc -q",
Expand Down

0 comments on commit 3eb335f

Please sign in to comment.