Skip to content

Commit 97aee7e

Browse files
Add GitHub Actions workflows for CI testing and releases
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 78a2382 commit 97aee7e

2 files changed

Lines changed: 144 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
test:
10+
uses: ./.github/workflows/test.yml
11+
12+
release:
13+
needs: test
14+
runs-on: macos-latest
15+
timeout-minutes: 10
16+
permissions:
17+
contents: write
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: 'lts/*'
27+
cache: 'npm'
28+
29+
- name: Install dependencies
30+
run: npm ci
31+
32+
- name: Build extensions
33+
run: npm run build
34+
35+
- name: Create GitHub Release
36+
env:
37+
GH_TOKEN: ${{ github.token }}
38+
run: |
39+
TAG="${{ github.ref_name }}"
40+
PRERELEASE_FLAG=""
41+
if [[ "$TAG" == *-* ]]; then
42+
PRERELEASE_FLAG="--prerelease"
43+
fi
44+
gh release create "$TAG" \
45+
build/bundle/*.zip build/bundle/*.xpi \
46+
--generate-notes \
47+
$PRERELEASE_FLAG

.github/workflows/test.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [main, development]
6+
pull_request:
7+
branches: [main, development]
8+
workflow_call:
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
test:
16+
runs-on: macos-latest
17+
timeout-minutes: 15
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: 'lts/*'
27+
cache: 'npm'
28+
29+
- name: Log environment versions
30+
run: |
31+
echo "macOS: $(sw_vers -productVersion)"
32+
echo "Node: $(node --version)"
33+
echo "Chrome: $(/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --version)"
34+
echo "Firefox: $(/Applications/Firefox.app/Contents/MacOS/firefox --version)"
35+
36+
- name: Install dependencies
37+
run: npm ci
38+
39+
- name: Cache Playwright browsers
40+
id: playwright-cache
41+
uses: actions/cache@v4
42+
with:
43+
path: ~/Library/Caches/ms-playwright
44+
key: playwright-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
45+
46+
- name: Install Playwright browsers
47+
if: steps.playwright-cache.outputs.cache-hit != 'true'
48+
run: npx playwright install chromium --with-deps
49+
50+
- name: Install Playwright dependencies
51+
if: steps.playwright-cache.outputs.cache-hit == 'true'
52+
run: npx playwright install-deps chromium
53+
54+
- name: Build Chrome extension
55+
run: npm run build:chrome
56+
57+
- name: Run tests
58+
run: npm test
59+
60+
- name: Upload Playwright report
61+
uses: actions/upload-artifact@v4
62+
if: failure()
63+
with:
64+
name: playwright-report
65+
path: playwright-report/
66+
retention-days: 7
67+
68+
- name: Upload test results
69+
uses: actions/upload-artifact@v4
70+
if: failure()
71+
with:
72+
name: test-results
73+
path: test-results/
74+
retention-days: 7
75+
76+
lint:
77+
runs-on: macos-latest
78+
timeout-minutes: 5
79+
80+
steps:
81+
- name: Checkout
82+
uses: actions/checkout@v4
83+
84+
- name: Setup Node.js
85+
uses: actions/setup-node@v4
86+
with:
87+
node-version: 'lts/*'
88+
cache: 'npm'
89+
90+
- name: Install dependencies
91+
run: npm ci
92+
93+
- name: Build Firefox extension
94+
run: npm run build:firefox
95+
96+
- name: Lint extension
97+
run: npm run lint

0 commit comments

Comments
 (0)