Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Lighthouse

on: [pull_request]

jobs:
lhci:
name: Lighthouse
runs-on: ubuntu-latest
steps:
- name: Checkout the project
uses: actions/checkout@v2

- name: Use Node.js 14.x (LTS)
uses: actions/setup-node@v1
with:
node-version: 14.x

- name: Use Ruby 2.7
uses: actions/setup-ruby@v1
with:
ruby-version: '2.7'

- name: Restore npm cache
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Restore Bundler cache
uses: actions/cache@v2
with:
path: docs/vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-

- name: Configure Bundler cache
run: |
bundle config path vendor/bundle

- name: Install dependencies
run: |
npm ci
cd docs && bundle install && cd ..

- name: Build docs
run: npm run build:docs
env:
JEKYLL_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run Lighthouse CI
run: npx lhci autorun
env:
JEKYLL_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LHCI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ node_modules
_site
*.tsbuildinfo
lib/
.jekyll-cache
.jekyll-cache
.lighthouseci
3 changes: 2 additions & 1 deletion docs/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ gem 'jekyll', '~> 4.1.1'

group :jekyll_plugins do
gem 'jekyll-commonmark-ghpages', '~> 0.1.5'
gem "jekyll-github-metadata"
gem 'jekyll-github-metadata'
gem 'jekyll-gzip'
end
3 changes: 3 additions & 0 deletions docs/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ GEM
jekyll-github-metadata (2.13.0)
jekyll (>= 3.4, < 5.0)
octokit (~> 4.0, != 4.4.0)
jekyll-gzip (2.4.2)
jekyll (>= 3.0, < 5.0)
jekyll-sass-converter (2.1.0)
sassc (> 2.0.1, < 3.0)
jekyll-watch (2.2.1)
Expand Down Expand Up @@ -87,6 +89,7 @@ DEPENDENCIES
jekyll (~> 4.1.1)
jekyll-commonmark-ghpages (~> 0.1.5)
jekyll-github-metadata
jekyll-gzip

BUNDLED WITH
2.1.4
9 changes: 6 additions & 3 deletions docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Catalyst
markdown: CommonMarkGhPages

commonmark:
extensions: ["autolink", "table"]
extensions: ['autolink', 'table']

permalink: pretty

Expand All @@ -16,11 +16,14 @@ collections:
guide:
output: true

defaults:
defaults:
- scope:
type: guide
values:
layout: guide

repository: github/catalyst

plugins:
- "jekyll-github-metadata"
- 'jekyll-github-metadata'
- 'jekyll-gzip'
4 changes: 3 additions & 1 deletion docs/_layouts/default.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
---
---
<!DOCTYPE html>
<html class="height-full">
<html lang="en" class="height-full">
<head>
<title>{% if page.title %}{{ page.title }} - {% endif %}{{ site.title }}</title>
<meta name="description" content="Catalyst is a set of patterns and techniques for developing components within a complex application.">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="{{ site.baseurl }}/primer.css">
<link rel="stylesheet" href="{{ site.baseurl }}/github-syntax.css">
<link rel="stylesheet" href="{{ site.baseurl }}/custom.css">
Expand Down
23 changes: 23 additions & 0 deletions lighthouserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"ci": {
"collect": {
"url": ["http://localhost:4000/"],
Comment thread
smockle marked this conversation as resolved.
"startServerCommand": "cd docs && bundle exec jekyll serve"
},
"assert": {
"preset": "lighthouse:no-pwa",
"assertions": {
"unused-css-rules": "off",
"uses-text-compression": "off",
"render-blocking-resources": "off",
"uses-rel-preload": "off",
"first-contentful-paint": ["warn", {"minScore": 0.8}],
"first-meaningful-paint": ["warn", {"minScore": 0.8}],
"largest-contentful-paint": ["warn", {"minScore": 0.8}]
}
},
"upload": {
"target": "temporary-public-storage"
}
}
}
Loading