diff --git a/.gitea/workflows/pwa-audit.yml b/.gitea/workflows/pwa-audit.yml new file mode 100644 index 0000000..a860964 --- /dev/null +++ b/.gitea/workflows/pwa-audit.yml @@ -0,0 +1,34 @@ +name: PWA + Mobile A11y Audit + +on: + pull_request: + +jobs: + lighthouse: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "22" + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Build + run: npm run build + + - name: Start server + run: npm run start & + env: + PORT: 3000 + + - name: Wait for server + run: sleep 10 + + - name: Run Lighthouse CI + run: npx lhci autorun diff --git a/lighthouserc.json b/lighthouserc.json new file mode 100644 index 0000000..b43cb18 --- /dev/null +++ b/lighthouserc.json @@ -0,0 +1,26 @@ +{ + "ci": { + "collect": { + "url": [ + "http://localhost:3000/admin/v2/orders", + "http://localhost:3000/admin/v2/stops", + "http://localhost:3000/admin/v2/products" + ], + "numberOfRuns": 1, + "settings": { + "preset": "mobile", + "emulatedFormFactor": "mobile" + } + }, + "assert": { + "assertions": { + "categories:performance": ["error", { "minScore": 0.9 }], + "categories:accessibility": ["error", { "minScore": 0.95 }], + "categories:pwa": "error", + "installable-manifest": "error", + "service-worker": "error", + "themed-omnibox": "warn" + } + } + } +} diff --git a/package.json b/package.json index fc629f2..a22f832 100644 --- a/package.json +++ b/package.json @@ -62,6 +62,7 @@ "zod": "^4.4.3" }, "devDependencies": { + "@lhci/cli": "^0.15.1", "@playwright/test": "^1.60.0", "@tailwindcss/postcss": "^4", "@types/node": "^20",