Skip to content

Commit 8752f82

Browse files
Copilothotlong
andcommitted
Add comprehensive automation workflows and CI/CD pipeline
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 0f64ee4 commit 8752f82

File tree

8 files changed

+382
-0
lines changed

8 files changed

+382
-0
lines changed

.github/dependabot.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
version: 2
2+
updates:
3+
# Enable version updates for npm dependencies
4+
- package-ecosystem: "npm"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
day: "monday"
9+
open-pull-requests-limit: 5
10+
reviewers:
11+
- "hotlong"
12+
assignees:
13+
- "hotlong"
14+
commit-message:
15+
prefix: "chore"
16+
include: "scope"
17+
labels:
18+
- "dependencies"
19+
- "automated"
20+
21+
# Core package dependencies
22+
- package-ecosystem: "npm"
23+
directory: "/packages/core"
24+
schedule:
25+
interval: "weekly"
26+
day: "monday"
27+
open-pull-requests-limit: 5
28+
reviewers:
29+
- "hotlong"
30+
assignees:
31+
- "hotlong"
32+
commit-message:
33+
prefix: "chore"
34+
prefix-development: "chore"
35+
include: "scope"
36+
labels:
37+
- "dependencies"
38+
- "core"
39+
- "automated"
40+
41+
# Examples package dependencies
42+
- package-ecosystem: "npm"
43+
directory: "/packages/examples"
44+
schedule:
45+
interval: "weekly"
46+
day: "monday"
47+
open-pull-requests-limit: 5
48+
reviewers:
49+
- "hotlong"
50+
assignees:
51+
- "hotlong"
52+
commit-message:
53+
prefix: "chore"
54+
prefix-development: "chore"
55+
include: "scope"
56+
labels:
57+
- "dependencies"
58+
- "examples"
59+
- "automated"
60+
61+
# GitHub Actions
62+
- package-ecosystem: "github-actions"
63+
directory: "/"
64+
schedule:
65+
interval: "weekly"
66+
day: "monday"
67+
open-pull-requests-limit: 3
68+
reviewers:
69+
- "hotlong"
70+
assignees:
71+
- "hotlong"
72+
commit-message:
73+
prefix: "ci"
74+
include: "scope"
75+
labels:
76+
- "github-actions"
77+
- "automated"

.github/labeler.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Auto-labeling configuration
2+
# Add labels to pull requests based on the files that are changed
3+
4+
'core':
5+
- changed-files:
6+
- any-glob-to-any-file: 'packages/core/**/*'
7+
8+
'examples':
9+
- changed-files:
10+
- any-glob-to-any-file: 'packages/examples/**/*'
11+
12+
'documentation':
13+
- changed-files:
14+
- any-glob-to-any-file:
15+
- '*.md'
16+
- 'packages/**/README.md'
17+
18+
'dependencies':
19+
- changed-files:
20+
- any-glob-to-any-file:
21+
- 'package.json'
22+
- 'package-lock.json'
23+
- 'packages/*/package.json'
24+
- 'packages/*/package-lock.json'
25+
26+
'ci/cd':
27+
- changed-files:
28+
- any-glob-to-any-file:
29+
- '.github/workflows/**/*'
30+
- '.github/dependabot.yml'
31+
32+
'typescript':
33+
- changed-files:
34+
- any-glob-to-any-file:
35+
- '**/*.ts'
36+
- '**/tsconfig.json'
37+
38+
'configuration':
39+
- changed-files:
40+
- any-glob-to-any-file:
41+
- '**/*.config.ts'
42+
- '**/*.config.js'
43+
- '**/*.config.json'
44+
- '.gitignore'

.github/workflows/auto-label.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Auto Label
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
jobs:
8+
label:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
pull-requests: write
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Label based on changed files
19+
uses: actions/labeler@v5
20+
with:
21+
repo-token: ${{ secrets.GITHUB_TOKEN }}
22+
configuration-path: .github/labeler.yml

.github/workflows/ci.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
build-and-test:
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
node-version: [18.x, 20.x]
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Node.js ${{ matrix.node-version }}
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
cache: 'npm'
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
31+
- name: Type check
32+
run: npm run type-check
33+
34+
- name: Build all packages
35+
run: npm run build
36+
37+
- name: Run basic example
38+
run: npm run example:basic
39+
40+
- name: Run e-commerce example
41+
run: npm run example:ecommerce
42+
43+
- name: Run blog example
44+
run: npm run example:blog
45+
46+
- name: Run CRM example
47+
run: npm run example:crm
48+
49+
- name: Run comprehensive CRM example
50+
run: npm run example:crm-comprehensive
51+
52+
- name: Archive build artifacts
53+
if: matrix.node-version == '20.x'
54+
uses: actions/upload-artifact@v4
55+
with:
56+
name: dist
57+
path: |
58+
packages/*/dist
59+
retention-days: 7

.github/workflows/code-quality.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Code Quality
2+
3+
on:
4+
pull_request:
5+
branches: [ main, develop ]
6+
workflow_dispatch:
7+
8+
jobs:
9+
quality-checks:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: '20.x'
20+
cache: 'npm'
21+
22+
- name: Install dependencies
23+
run: npm ci
24+
25+
- name: Type check all packages
26+
run: npm run type-check
27+
28+
- name: Check for TypeScript errors
29+
run: |
30+
echo "Checking for TypeScript compilation errors..."
31+
npm run build 2>&1 | tee build.log
32+
if grep -i "error TS" build.log; then
33+
echo "TypeScript errors found!"
34+
exit 1
35+
fi
36+
echo "No TypeScript errors found."
37+
38+
- name: Check package structure
39+
run: |
40+
echo "Verifying package structure..."
41+
test -f packages/core/package.json || exit 1
42+
test -f packages/examples/package.json || exit 1
43+
test -d packages/core/src || exit 1
44+
test -d packages/examples/src || exit 1
45+
echo "Package structure verified."
46+
47+
- name: Verify examples can run
48+
run: |
49+
echo "Testing if examples can execute..."
50+
npm run build
51+
npm run example:basic
52+
echo "Examples verified successfully."

.github/workflows/release.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
release:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: '20.x'
26+
cache: 'npm'
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
31+
- name: Build all packages
32+
run: npm run build
33+
34+
- name: Create Release
35+
uses: softprops/action-gh-release@v1
36+
with:
37+
generate_release_notes: true
38+
files: |
39+
packages/*/package.json
40+
README.md
41+
CRM_DOCUMENTATION.md
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/stale.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Stale Issues and PRs
2+
3+
on:
4+
schedule:
5+
# Run daily at 00:00 UTC
6+
- cron: '0 0 * * *'
7+
workflow_dispatch:
8+
9+
jobs:
10+
stale:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
issues: write
14+
pull-requests: write
15+
16+
steps:
17+
- name: Mark stale issues and PRs
18+
uses: actions/stale@v9
19+
with:
20+
repo-token: ${{ secrets.GITHUB_TOKEN }}
21+
22+
# Issues configuration
23+
stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within 7 days. Thank you for your contributions.'
24+
close-issue-message: 'This issue was automatically closed due to inactivity. Please feel free to reopen if this is still relevant.'
25+
days-before-issue-stale: 60
26+
days-before-issue-close: 7
27+
stale-issue-label: 'stale'
28+
exempt-issue-labels: 'pinned,security,enhancement'
29+
30+
# PRs configuration
31+
stale-pr-message: 'This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within 7 days. Please rebase and update if you would like to continue working on this.'
32+
close-pr-message: 'This pull request was automatically closed due to inactivity. Please feel free to reopen or submit a new PR if this is still relevant.'
33+
days-before-pr-stale: 30
34+
days-before-pr-close: 7
35+
stale-pr-label: 'stale'
36+
exempt-pr-labels: 'pinned,security,work-in-progress'
37+
38+
# General configuration
39+
operations-per-run: 30
40+
remove-stale-when-updated: true
41+
ascending: true

0 commit comments

Comments
 (0)