ci: add commitlint, update eslint

This commit is contained in:
Isaac 2023-02-13 14:33:27 +00:00
parent 380a84617a
commit f428fac4e5
No known key found for this signature in database
GPG Key ID: 0DE40AE37BBA5C33

View File

@ -1,30 +1,32 @@
name: eslint name: Lint
on: on: [push, pull_request]
push: # push:
branches: # branches:
- main # - main
# pull_request: # pull_request:
# branches: # branches:
# - main # - main
jobs: jobs:
lint: commitlint:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/setup-node@v2
- name: Cache pnpm modules
uses: actions/cache@v2
env:
cache-name: cache-pnpm-modules
with: with:
path: ~/.pnpm-store fetch-depth: 0
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/package.json') }} - uses: wagoid/commitlint-github-action@v5
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-
- uses: pnpm/action-setup@v2.0.1
with: with:
version: 6.3.0 configFile: .commitlintrc.js
run_install: false eslint:
- run: pnpm install eslint runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 7
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'pnpm'
- run: pnpm install
- run: pnpm run lint - run: pnpm run lint