Skip to content

Commit 033b5ab

Browse files
authored
Merge pull request #4 from objectstack-ai/copilot/add-necessary-automation-workflows
2 parents 4da00e6 + a67a9b3 commit 033b5ab

File tree

5 files changed

+212
-0
lines changed

5 files changed

+212
-0
lines changed

.github/dependabot.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
version: 2
2+
updates:
3+
# Enable version updates for npm
4+
- package-ecosystem: "npm"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
day: "monday"
9+
open-pull-requests-limit: 10
10+
versioning-strategy: increase
11+
labels:
12+
- "dependencies"
13+
- "automated"
14+
commit-message:
15+
prefix: "chore"
16+
include: "scope"
17+
18+
# Enable version updates for GitHub Actions
19+
- package-ecosystem: "github-actions"
20+
directory: "/"
21+
schedule:
22+
interval: "weekly"
23+
day: "monday"
24+
open-pull-requests-limit: 5
25+
labels:
26+
- "dependencies"
27+
- "github-actions"
28+
- "automated"
29+
commit-message:
30+
prefix: "chore"
31+
include: "scope"

.github/workflows/ci.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main, develop]
8+
9+
jobs:
10+
build:
11+
name: Build and Type Check
12+
runs-on: ubuntu-latest
13+
14+
permissions:
15+
contents: read
16+
17+
strategy:
18+
matrix:
19+
node-version: [18.x, 20.x]
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v4
24+
25+
- name: Setup Node.js ${{ matrix.node-version }}
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: ${{ matrix.node-version }}
29+
cache: 'npm'
30+
31+
- name: Install dependencies
32+
run: npm ci --legacy-peer-deps || npm install --legacy-peer-deps
33+
34+
- name: Type check
35+
run: npm run typecheck
36+
37+
- name: Build
38+
run: npm run build
39+
40+
- name: Upload build artifacts
41+
if: matrix.node-version == '20.x'
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: build-artifacts
45+
path: dist/
46+
retention-days: 7

.github/workflows/code-quality.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Code Quality
2+
3+
on:
4+
pull_request:
5+
branches: [main, develop]
6+
7+
jobs:
8+
dependency-review:
9+
name: Dependency Review
10+
runs-on: ubuntu-latest
11+
if: github.event_name == 'pull_request'
12+
13+
permissions:
14+
contents: read
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Dependency Review
21+
uses: actions/dependency-review-action@v4
22+
with:
23+
fail-on-severity: moderate
24+
25+
codeql:
26+
name: CodeQL Security Analysis
27+
runs-on: ubuntu-latest
28+
29+
permissions:
30+
security-events: write
31+
actions: read
32+
contents: read
33+
34+
steps:
35+
- name: Checkout code
36+
uses: actions/checkout@v4
37+
38+
- name: Initialize CodeQL
39+
uses: github/codeql-action/init@v3
40+
with:
41+
languages: typescript, javascript
42+
43+
- name: Autobuild
44+
uses: github/codeql-action/autobuild@v3
45+
46+
- name: Perform CodeQL Analysis
47+
uses: github/codeql-action/analyze@v3

.github/workflows/release.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
9+
jobs:
10+
release:
11+
name: Build and Release
12+
runs-on: ubuntu-latest
13+
14+
permissions:
15+
contents: write
16+
packages: write
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: '20.x'
26+
cache: 'npm'
27+
registry-url: 'https://registry.npmjs.org'
28+
29+
- name: Install dependencies
30+
run: npm ci --legacy-peer-deps || npm install --legacy-peer-deps
31+
32+
- name: Type check
33+
run: npm run typecheck
34+
35+
- name: Build
36+
run: npm run build
37+
38+
- name: Create GitHub Release
39+
uses: softprops/action-gh-release@v1
40+
if: startsWith(github.ref, 'refs/tags/')
41+
with:
42+
draft: false
43+
generate_release_notes: true
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
47+
# Uncomment when ready to publish to npm
48+
# - name: Publish to npm
49+
# if: startsWith(github.ref, 'refs/tags/')
50+
# run: npm publish --access public
51+
# env:
52+
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

CONTRIBUTING.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,42 @@ When adding tests (future work):
131131
git push origin feature/your-feature-name
132132
```
133133

134+
## Automated Workflows
135+
136+
This repository includes several GitHub Actions workflows to ensure code quality:
137+
138+
### CI Workflow
139+
- **Trigger**: Pull requests and pushes to `main` or `develop` branches
140+
- **Actions**:
141+
- Type checking with TypeScript
142+
- Building the project
143+
- Runs on Node.js 18.x and 20.x
144+
- **Location**: `.github/workflows/ci.yml`
145+
146+
### Code Quality Workflow
147+
- **Trigger**: Pull requests to `main` or `develop` branches
148+
- **Actions**:
149+
- Dependency review (fails on moderate+ severity issues)
150+
- CodeQL security analysis for TypeScript/JavaScript
151+
- **Location**: `.github/workflows/code-quality.yml`
152+
153+
### Release Workflow
154+
- **Trigger**: Version tags (v*) or manual dispatch
155+
- **Actions**:
156+
- Type checking and building
157+
- Creating GitHub releases with auto-generated release notes
158+
- npm publishing (commented out, ready to enable)
159+
- **Location**: `.github/workflows/release.yml`
160+
161+
### Dependabot
162+
- **Schedule**: Weekly (Mondays)
163+
- **Updates**:
164+
- npm dependencies
165+
- GitHub Actions versions
166+
- **Configuration**: `.github/dependabot.yml`
167+
168+
All PRs will automatically run CI and code quality checks. Make sure your changes pass all checks before requesting review.
169+
134170
## Common Tasks
135171

136172
### Adding a New Auth Provider

0 commit comments

Comments
 (0)