-
Notifications
You must be signed in to change notification settings - Fork 1
Feat/0 2 pwa installability #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
46764fc
feat: enhance meal management features in UI polish release
gcharest 76093c2
feat: add conceptual proposal for complete app redesign
gcharest 17c2d63
feat: add unit tests for meal and nutrient file stores
gcharest 161c31d
feat: add Lighthouse CI workflow for performance testing
gcharest 690cb02
feat: enhance PWA support with manifest, icons, and installation tests
gcharest f7d35ea
feat: update package versions and increment project version to 0.2.0
gcharest 1a12cd3
fix: lint
gcharest 7dd8b2b
fix: fmt
gcharest 0c21dad
fix: add permissions for Lighthouse CI workflow
gcharest e92c5bf
fix: update code blocks to use text syntax
gcharest b4b7f80
feat: enhance Lighthouse CI workflow with detailed PR comments and re…
gcharest 68b422b
feat: improve preview server startup process with retries and logging
gcharest f3a4cd5
feat: streamline accessibility tests workflow
gcharest 28125ef
feat: update background color in manifest
gcharest 2795f89
feat: refine homepage tests for language switching
gcharest 31e7921
feat: update PWA installation tests
gcharest 03170e5
feat: update manifest link in index.html
gcharest 83acf38
feat: optimize browser configuration for local development
gcharest 2828779
feat: refine caching strategy for app data JSON files
gcharest 2869bfd
feat: skip service worker test in development mode
gcharest 7973601
feat: skip language toggle test
gcharest e6137b6
feat: update browser configuration to include Firefox in local develo…
gcharest aa96225
fix: revert accessibility workflow
gcharest File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,116 @@ | ||
| name: Lighthouse CI | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main, develop] | ||
| pull_request: | ||
| branches: [main, develop] | ||
|
|
||
| jobs: | ||
| lighthouse: | ||
| 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' | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Build application | ||
| run: npm run build | ||
|
|
||
| - name: Start preview server | ||
| run: | | ||
| npm run preview > /tmp/server.log 2>&1 & | ||
| echo $! > /tmp/server.pid | ||
|
|
||
| # Wait for server to start (retry up to 30 times, 2 second intervals) | ||
| for i in {1..30}; do | ||
| if curl -f http://localhost:4173/gluko/ > /dev/null 2>&1; then | ||
| echo "✓ Server started successfully" | ||
| exit 0 | ||
| fi | ||
| echo "Waiting for server... ($i/30)" | ||
| sleep 2 | ||
| done | ||
|
|
||
| echo "✗ Server failed to start" | ||
| cat /tmp/server.log | ||
| exit 1 | ||
|
|
||
| - name: Run Lighthouse CI | ||
| uses: treosh/lighthouse-ci-action@v11 | ||
| with: | ||
| configPath: ./lighthouse-budget.json | ||
| temporaryPublicStorage: true | ||
| runs: 1 | ||
| uploadArtifacts: true | ||
| # Use lighthouse-ci Docker image with Chromium pre-installed for faster execution | ||
| # This skips the slow package installation step | ||
| chartJson: true | ||
|
|
||
| - name: Comment PR with results | ||
| if: github.event_name == 'pull_request' | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| script: | | ||
| const fs = require('fs'); | ||
| const resultsPath = '.lighthouseci/lhr-latest.json'; | ||
|
|
||
| if (!fs.existsSync(resultsPath)) { | ||
| console.log('No Lighthouse results found'); | ||
| return; | ||
| } | ||
|
|
||
| const results = JSON.parse(fs.readFileSync(resultsPath, 'utf-8')); | ||
| const categories = results.categories || {}; | ||
|
|
||
| const formatScore = (score) => { | ||
| if (!score) return 'N/A'; | ||
| return Math.round(score.score * 100); | ||
| }; | ||
|
|
||
| const comment = `## 📊 Lighthouse Report | ||
|
|
||
| | Metric | Score | | ||
| |--------|-------| | ||
| | Performance | ${formatScore(categories.performance)} | | ||
| | Accessibility | ${formatScore(categories.accessibility)} | | ||
| | Best Practices | ${formatScore(categories['best-practices'])} | | ||
| | SEO | ${formatScore(categories.seo)} | | ||
| | PWA | ${formatScore(categories.pwa)} | | ||
|
|
||
| [View full report](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})`; | ||
|
|
||
| github.rest.issues.createComment({ | ||
| issue_number: context.issue.number, | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| body: comment | ||
| }); | ||
|
|
||
| - name: Upload Lighthouse results | ||
| uses: actions/upload-artifact@v4 | ||
| if: always() | ||
| with: | ||
| name: lighthouse-results | ||
| path: '.lighthouseci' | ||
| retention-days: 30 | ||
|
|
||
| - name: Clean up server | ||
| if: always() | ||
| run: | | ||
| if [ -f /tmp/server.pid ]; then | ||
| kill $(cat /tmp/server.pid) 2>/dev/null || true | ||
| fi | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,7 @@ node_modules | |
| .DS_Store | ||
| dist | ||
| dist-ssr | ||
| dev-dist | ||
| coverage | ||
| *.local | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.