Skip to content

Commit

Permalink
ci: init
Browse files Browse the repository at this point in the history
  • Loading branch information
gao-sun committed Feb 17, 2024
1 parent c693905 commit 4e59e55
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Commitlint

on:
pull_request:
types: [opened, edited, synchronize, reopened]

concurrency:
group: commitlint-${{ github.ref }}
cancel-in-progress: true

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

- name: Setup Node and pnpm
uses: silverhand-io/actions-node-pnpm-run-steps@v4

- name: Commitlint
run: npx commitlint --from HEAD~${{ github.event.pull_request.commits }} --to HEAD

- name: Commitlint on PR title
run: echo '${{ github.event.pull_request.title }}' | npx commitlint
31 changes: 31 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Main

on:
push:
branches:
- master
- dev
pull_request:

concurrency:
group: main-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
main:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup Node and pnpm
uses: silverhand-io/actions-node-pnpm-run-steps@v4

- name: Build
run: pnpm -r build

- name: Lint
run: pnpm -r lint

- name: Test
run: pnpm -r test

0 comments on commit 4e59e55

Please sign in to comment.