From bb7180328ecbff2e7bf9c6e884e782b7029851df Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Sat, 5 Mar 2022 15:18:17 +0100 Subject: [PATCH] tests: run lighthouse against preview deployments in CI (#107) --- .github/workflows/lighthouse.yml | 28 ++++++++++++++++++++++++++++ www/routes/index.tsx | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/lighthouse.yml diff --git a/.github/workflows/lighthouse.yml b/.github/workflows/lighthouse.yml new file mode 100644 index 00000000..9fa7a051 --- /dev/null +++ b/.github/workflows/lighthouse.yml @@ -0,0 +1,28 @@ +name: live + +on: [deployment_status] + +jobs: + lighthouse: + name: lighthouse + runs-on: ubuntu-latest + if: github.event.deployment_status.state == 'success' && github.event.deployment_status.creator.login == 'deno-deploy[bot]' + + env: + URL: ${{ github.event.deployment_status.environment_url }} + + steps: + - uses: actions/checkout@v2 + + - name: Install Node.js 16.x + uses: actions/setup-node@v1 + with: + node-version: 16.x + + - name: Install Lighthouse CI + run: npm install -g @lhci/cli@0.9.x + + - name: Run Lighthouse + run: lhci autorun --collect.url="$URL" --upload.target="temporary-public-storage" + env: + LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }} diff --git a/www/routes/index.tsx b/www/routes/index.tsx index 32652f51..d468af0c 100644 --- a/www/routes/index.tsx +++ b/www/routes/index.tsx @@ -26,7 +26,7 @@ export default function MainPage() { function Hero() { const container = tw`w-full h-64 flex justify-center items-center flex-col`; const title = tw - `text(4xl sm:5xl lg:6xl gray-900) sm:tracking-tight font-extrabold`; + `text(4xl sm:5xl lg:6xl gray-900 center) sm:tracking-tight font-extrabold`; const subtitle = tw`mt-4 text(2xl gray-600)`; return (