Skip to content

Commit 10adf7e

Browse files
committed
add format ci
1 parent 83b5bf5 commit 10adf7e

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/format.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Chrome Extension CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build-and-check:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repo
15+
uses: actions/checkout@v3
16+
17+
- name: Setup Node
18+
uses: actions/setup-node@v3
19+
with:
20+
node-version: 20
21+
22+
- name: Install dependencies
23+
run: npm ci
24+
25+
- name: Lint with ESLint
26+
run: npm run lint
27+
28+
- name: Check Prettier format
29+
run: npx prettier --check 'src/**/*.{js,html,css}'
30+
31+
- name: Build extension
32+
run: npm run build
33+
34+
- name: Zip dist/
35+
run: zip -r dist.zip dist
36+
37+
- name: Check zip file exists
38+
run: test -f dist.zip && echo "dist.zip created"
39+
40+
- name: Validate manifest.json
41+
run: |
42+
npx --yes @fregante/webext-validate dist/manifest.json
43+
44+
- name: Inspect zip content
45+
run: unzip -l dist.zip | grep -E 'manifest\.json|popup\.html|content\.js'

0 commit comments

Comments
 (0)