81 lines
2.5 KiB
YAML
81 lines
2.5 KiB
YAML
name: CI — Chrome
|
|
|
|
on:
|
|
push:
|
|
branches: [main, develop]
|
|
paths:
|
|
- 'packages/chrome/**'
|
|
- 'src/lib/**'
|
|
- 'tests/**'
|
|
- '.gitea/workflows/ci-chrome.yml'
|
|
pull_request:
|
|
branches: [main]
|
|
paths:
|
|
- 'packages/chrome/**'
|
|
- 'src/lib/**'
|
|
- 'tests/**'
|
|
- '.gitea/workflows/ci-chrome.yml'
|
|
|
|
jobs:
|
|
chrome:
|
|
name: Chrome — typecheck, test, build
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
container:
|
|
image: node:22-bookworm
|
|
|
|
steps:
|
|
- name: Install system deps
|
|
run: apt-get update -qq && apt-get install -y git ca-certificates -qq
|
|
|
|
- name: Clone repository
|
|
run: |
|
|
git clone ${{ gitea.server_url }}/${{ gitea.repository }}.git /tmp/lexai
|
|
cd /tmp/lexai
|
|
if [ "${{ gitea.event_name }}" = "pull_request" ]; then
|
|
git fetch origin pull/${{ gitea.event.pull_request.number }}/head:pr
|
|
git checkout pr
|
|
else
|
|
git checkout ${{ gitea.sha }}
|
|
fi
|
|
|
|
- name: Install dependencies
|
|
run: npm ci --prefer-offline --no-audit --no-fund
|
|
working-directory: /tmp/lexai/packages/chrome
|
|
|
|
- name: Prepare WXT types
|
|
run: npx wxt prepare
|
|
working-directory: /tmp/lexai/packages/chrome
|
|
|
|
- name: Typecheck
|
|
run: npm run typecheck
|
|
working-directory: /tmp/lexai/packages/chrome
|
|
|
|
- name: Unit tests
|
|
run: npm test -- --run
|
|
working-directory: /tmp/lexai/packages/chrome
|
|
|
|
- name: Build
|
|
run: npm run build
|
|
working-directory: /tmp/lexai/packages/chrome
|
|
|
|
- name: Verify output
|
|
run: ls -la .output/chrome-mv3/
|
|
working-directory: /tmp/lexai/packages/chrome
|
|
|
|
- name: Notify Success
|
|
if: success()
|
|
run: |
|
|
SHA=$(echo "${{ gitea.sha }}" | cut -c1-7)
|
|
curl -s -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \
|
|
-d "chat_id=${{ secrets.TELEGRAM_CHAT_ID }}" \
|
|
-d "text=✅ LexAI CI Chrome Passed%0ABranch: ${{ gitea.ref_name }}%0ACommit: ${SHA}"
|
|
|
|
- name: Notify Failure
|
|
if: failure()
|
|
run: |
|
|
SHA=$(echo "${{ gitea.sha }}" | cut -c1-7)
|
|
curl -s -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \
|
|
-d "chat_id=${{ secrets.TELEGRAM_CHAT_ID }}" \
|
|
-d "text=❌ LexAI CI Chrome FAILED%0ABranch: ${{ gitea.ref_name }}%0ACommit: ${SHA}%0Ahttps://git.juankibin.space/kibin/LexAI/actions"
|