Repository navigation
129 lines (107 loc) · 3.44 KB
/
Copy pathci.yml
File metadata and controls
129 lines (107 loc) · 3.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: CI - Build and Test Extension
on:
push:
branches:
- main
- develop
paths:
- 'elyune-extension/**'
- '.github/workflows/ci.yml'
pull_request:
branches:
- main
- develop
paths:
- 'elyune-extension/**'
- '.github/workflows/ci.yml'
jobs:
build-and-test:
name: Build & Test Extension
runs-on: ubuntu-latest
strategy:
matrix:
browser: [chrome, firefox]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: elyune-extension/package-lock.json
- name: Install dependencies
run: npm ci
working-directory: elyune-extension
- name: Type check
run: npm run compile
working-directory: elyune-extension
- name: Build extension - ${{ matrix.browser }}
run: |
if [ "${{ matrix.browser }}" = "chrome" ]; then
npm run build
else
npm run build:firefox
fi
working-directory: elyune-extension
- name: Create zip - ${{ matrix.browser }}
run: |
if [ "${{ matrix.browser }}" = "chrome" ]; then
npm run zip
else
npm run zip:firefox
fi
working-directory: elyune-extension
- name: Verify build output
run: |
if [ "${{ matrix.browser }}" = "chrome" ]; then
ZIP_FILE="elyune-1.0.0-chrome.zip"
else
ZIP_FILE="elyune-1.0.0-firefox.zip"
fi
echo "=== Build Output ==="
ls -lh elyune-extension/.output/
echo -e "\n=== Zip Contents ==="
unzip -l "elyune-extension/.output/$ZIP_FILE" | head -30
echo -e "\n=== Zip Size ==="
du -h "elyune-extension/.output/$ZIP_FILE"
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: elyune-${{ matrix.browser }}-${{ github.sha }}
path: elyune-extension/.output/elyune-1.0.0-${{ matrix.browser }}.zip
retention-days: 7
- name: Install Playwright browsers
run: npx playwright install --with-deps chromium
working-directory: elyune-extension
if: matrix.browser == 'chrome'
- name: Run tests
run: npm run test
working-directory: elyune-extension
if: matrix.browser == 'chrome'
continue-on-error: true # Don't fail build if no tests exist yet
- name: Upload test results
uses: actions/upload-artifact@v4
if: always() && matrix.browser == 'chrome'
with:
name: playwright-report
path: elyune-extension/playwright-report/
retention-days: 7
lint:
name: Lint Extension Code
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: elyune-extension/package-lock.json
- name: Install dependencies
run: npm ci
working-directory: elyune-extension
- name: Type check
run: npm run compile
working-directory: elyune-extension