Skip to content

Commit 015f6ac

Browse files
committed
Add CI, documentation deployment, and NPM publishing workflows
- Created a CI workflow to run tests and upload coverage reports on pushes and pull requests to main and develop branches. - Added a workflow for deploying documentation to GitHub Pages on pushes to the main branch. - Implemented a workflow for publishing packages to NPM on version tags and releases.
1 parent d7c2cf6 commit 015f6ac

7 files changed

Lines changed: 446 additions & 12 deletions

File tree

.github/workflows/ci.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- develop
8+
pull_request:
9+
branches:
10+
- main
11+
- develop
12+
13+
jobs:
14+
test:
15+
name: Run Tests
16+
runs-on: ubuntu-latest
17+
18+
strategy:
19+
matrix:
20+
node-version: [20.x, 22.x, 24.x, 25.x]
21+
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
26+
- name: Install pnpm
27+
uses: pnpm/action-setup@v2
28+
with:
29+
version: 8
30+
31+
- name: Setup Node.js ${{ matrix.node-version }}
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: ${{ matrix.node-version }}
35+
cache: "pnpm"
36+
37+
- name: Install dependencies
38+
run: pnpm install --no-frozen-lockfile
39+
40+
- name: Run linter
41+
run: pnpm lint
42+
43+
- name: Run tests
44+
run: pnpm test:coverage
45+
46+
- name: Upload coverage reports to Codecov
47+
uses: codecov/codecov-action@v5
48+
with:
49+
token: ${{ secrets.CODECOV_TOKEN }}
50+
slug: arcstack-hq/resora

.github/workflows/deploy-docs.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Deploy Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: pages
16+
cancel-in-progress: false
17+
18+
jobs:
19+
build:
20+
name: Build Documentation
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 0
28+
29+
- name: Install pnpm
30+
uses: pnpm/action-setup@v2
31+
with:
32+
version: 8
33+
34+
- name: Setup Node.js
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version: 20.x
38+
cache: 'pnpm'
39+
40+
- name: Setup Pages
41+
uses: actions/configure-pages@v4
42+
43+
- name: Install dependencies
44+
run: pnpm install --no-frozen-lockfile
45+
46+
- name: Build documentation
47+
run: pnpm docs:build
48+
49+
- name: Upload artifact
50+
uses: actions/upload-pages-artifact@v3
51+
with:
52+
path: docs/.vitepress/dist
53+
54+
deploy:
55+
name: Deploy to GitHub Pages
56+
environment:
57+
name: github-pages
58+
url: ${{ steps.deployment.outputs.page_url }}
59+
needs: build
60+
runs-on: ubuntu-latest
61+
62+
steps:
63+
- name: Deploy to GitHub Pages
64+
id: deployment
65+
uses: actions/deploy-pages@v4

.github/workflows/publish.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Publish to NPM
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
release:
8+
types: [published]
9+
workflow_dispatch:
10+
inputs:
11+
version:
12+
description: "Version to publish (optional)"
13+
required: false
14+
default: ""
15+
16+
jobs:
17+
publish:
18+
name: Publish to NPM
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: write
22+
id-token: write
23+
24+
steps:
25+
- name: Checkout code
26+
uses: actions/checkout@v4
27+
with:
28+
fetch-depth: 0
29+
token: ${{ secrets.GITHUB_TOKEN }}
30+
31+
- name: Install pnpm
32+
uses: pnpm/action-setup@v2
33+
with:
34+
version: 8
35+
36+
- name: Setup Node.js
37+
uses: actions/setup-node@v4
38+
with:
39+
node-version: 20.x
40+
cache: "pnpm"
41+
registry-url: "https://registry.npmjs.org"
42+
43+
- name: Install dependencies
44+
run: pnpm install --no-frozen-lockfile
45+
46+
- name: Configure Git
47+
run: |
48+
git config --global user.name "github-actions[bot]"
49+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
50+
51+
- name: Run linter
52+
run: pnpm lint
53+
54+
- name: Run tests
55+
run: pnpm test
56+
57+
- name: Publish to NPM
58+
run: pnpm publish:packages --no-git-checks
59+
env:
60+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ node_modules
22
# Keep environment variables out of version control
33
.env
44
dist
5+
.DS_Store
56

67
/generated/prisma
78
/storage/**
89
/storage/**
10+
/coverage
911
docs/architecture/unification-roadmap.md

oxlint.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ export default defineConfig({
2727
},
2828
],
2929
},
30-
ignorePatterns: ['dist/**', 'node_modules/**', 'src/**/*.spec.ts', 'coverage/**'],
30+
ignorePatterns: ['dist/**', 'node_modules/**', 'src/**/*.spec.ts', 'coverage/**', 'tests/**', 'stubs/**', 'docs/**'],
3131
plugins: ['eslint', 'typescript', 'import'],
3232
})

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"lint:fix": "oxlint --fix && oxfmt",
88
"test": "vitest run",
99
"test:watch": "vitest",
10+
"test:coverage": "vitest run --coverage",
1011
"test:integration": "vitest run tests/integration",
1112
"build:packages": "pnpm -r --filter \"@arcstack/*\" build",
1213
"publish:packages": "pnpm -r --filter \"@arcstack/*\" publish --access public",
@@ -20,6 +21,7 @@
2021
"devDependencies": {
2122
"@types/node": "^25.2.3",
2223
"@types/pg": "^8.16.0",
24+
"@vitest/coverage-v8": "3.2.4",
2325
"escalade": "^3.2.0",
2426
"glob": "^13.0.6",
2527
"oxfmt": "^0.32.0",

0 commit comments

Comments
 (0)