Skip to content

Commit 4b0d5e1

Browse files
committed
ci: add workflows and coverage dependency for CI
Add CI, deploy, and release workflows. Install @vitest/coverage-v8 for coverage reporting. Use --passWithNoTests for initial main branch.
1 parent 8e92a58 commit 4b0d5e1

5 files changed

Lines changed: 333 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
push:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-node@v4
15+
with:
16+
node-version: 22
17+
cache: npm
18+
- run: npm ci
19+
- run: npx tsc --noEmit
20+
- run: npx vitest run --coverage --passWithNoTests

.github/workflows/deploy.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
permissions:
8+
contents: read
9+
pages: write
10+
id-token: write
11+
12+
concurrency:
13+
group: pages
14+
cancel-in-progress: true
15+
16+
jobs:
17+
deploy:
18+
runs-on: ubuntu-latest
19+
environment:
20+
name: github-pages
21+
url: ${{ steps.deployment.outputs.page_url }}
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: actions/setup-node@v4
25+
with:
26+
node-version: 22
27+
cache: npm
28+
- run: npm ci
29+
- run: npm run build
30+
- uses: actions/configure-pages@v5
31+
- uses: actions/upload-pages-artifact@v3
32+
with:
33+
path: dist
34+
- id: deployment
35+
uses: actions/deploy-pages@v4

.github/workflows/release.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags: ['v*']
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
release:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: 22
18+
cache: npm
19+
- run: npm ci
20+
- run: npm run build
21+
- run: cp dist/index.html compose-sanitizer.html
22+
- uses: softprops/action-gh-release@v2
23+
with:
24+
files: compose-sanitizer.html
25+
generate_release_notes: true

0 commit comments

Comments
 (0)