Skip to content

Added basic api controller structure #26

Added basic api controller structure

Added basic api controller structure #26

Workflow file for this run

name: Lighthouse
on:
pull_request:
types:
- review_requested
jobs:
lighthouse:
name: Lighthouse Auditing
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.node_version }}
- name: Install dependencies
run: npm install
- name: Create .env file from .env.example
run: cat .env.example > .env
- name: Build application
run: npm run build
- name: Generate URLs
id: urls
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const globber = await glob.create('**/src/routes/**/+page.svelte');
const files = await globber.glob();
const urls = files
.map(x => x.match(/routes\/([a-zA-Z\/\[\]]*?)\/?\+page\.svelte/)[1])
.map(x => x.replace('[paperId]', '42').replace('[projectId]', '12'))
.map(x => `http://localhost:8080/${x}`)
.join('\n');
core.setOutput('urls', urls);
# Add '& echo ...' to run command in background
- name: Serve website
run: npm run preview -- --port 8080 & echo "Server started on http://localhost:8080"
- name: Audit URLs using Lighthouse
uses: treosh/lighthouse-ci-action@v12
with:
urls: |
${{ steps.urls.outputs.urls }}
uploadArtifacts: true
configPath: .github/lighthouserc.json