2021-06-16 18:37:37 +00:00
|
|
|
name: lighthouse
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
version:
|
|
|
|
description: 'Which branch do you want to test?' # Limited to branch for now
|
|
|
|
required: false
|
2022-02-17 01:12:00 +00:00
|
|
|
default: 'master'
|
|
|
|
pull_request:
|
|
|
|
types:
|
|
|
|
- labeled
|
2021-06-16 18:37:37 +00:00
|
|
|
jobs:
|
2022-02-17 01:12:00 +00:00
|
|
|
lighthouse-pr:
|
|
|
|
if: ${{ github.event.label.name == 'pr:lighthouse' }}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout Master for Baseline
|
2022-03-02 17:59:13 +00:00
|
|
|
uses: actions/checkout@v3
|
2022-02-17 01:12:00 +00:00
|
|
|
with:
|
|
|
|
ref: master #explicitly checkout master for baseline
|
2022-03-25 18:11:41 +00:00
|
|
|
- name: Install Node 16
|
2022-03-08 02:33:18 +00:00
|
|
|
uses: actions/setup-node@v3
|
2022-02-17 01:12:00 +00:00
|
|
|
with:
|
2022-03-25 18:11:41 +00:00
|
|
|
node-version: '16'
|
2022-02-17 01:12:00 +00:00
|
|
|
- name: Cache node modules
|
|
|
|
uses: actions/cache@v2
|
|
|
|
env:
|
|
|
|
cache-name: cache-node-modules
|
|
|
|
with:
|
|
|
|
path: ~/.npm
|
|
|
|
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
|
|
|
|
- name: npm install with lighthouse cli
|
|
|
|
run: npm install && npm install -g @lhci/cli
|
|
|
|
- name: Run lhci against master to generate baseline and ignore exit codes
|
|
|
|
run: lhci autorun || true
|
|
|
|
- name: Perform clean checkout of PR
|
2022-03-02 17:59:13 +00:00
|
|
|
uses: actions/checkout@v3
|
2022-02-17 01:12:00 +00:00
|
|
|
with:
|
|
|
|
clean: true
|
|
|
|
- name: Install Node version which is compatible with PR
|
2022-03-08 02:33:18 +00:00
|
|
|
uses: actions/setup-node@v3
|
2022-02-17 01:12:00 +00:00
|
|
|
- name: npm install with lighthouse cli
|
|
|
|
run: npm install && npm install -g @lhci/cli
|
|
|
|
- name: Run lhci with PR
|
|
|
|
run: lhci autorun
|
|
|
|
env:
|
|
|
|
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
|
|
|
|
lighthouse-nightly:
|
|
|
|
if: ${{ github.event.schedule }}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-03-02 17:59:13 +00:00
|
|
|
- uses: actions/checkout@v3
|
2022-03-25 18:11:41 +00:00
|
|
|
- name: Install Node 16
|
2022-03-08 02:33:18 +00:00
|
|
|
uses: actions/setup-node@v3
|
2022-02-17 01:12:00 +00:00
|
|
|
with:
|
2022-03-25 18:11:41 +00:00
|
|
|
node-version: '16'
|
2022-02-17 01:12:00 +00:00
|
|
|
- name: Cache node modules
|
|
|
|
uses: actions/cache@v2
|
|
|
|
env:
|
|
|
|
cache-name: cache-node-modules
|
|
|
|
with:
|
|
|
|
path: ~/.npm
|
|
|
|
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
|
|
|
|
- name: npm install with lighthouse cli
|
|
|
|
run: npm install && npm install -g @lhci/cli
|
|
|
|
- name: Run lhci against master to generate baseline
|
|
|
|
run: lhci autorun
|
|
|
|
env:
|
|
|
|
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
|
|
|
|
lighthouse-dispatch:
|
|
|
|
if: ${{ github.event.workflow_dispatch }}
|
2021-06-16 18:37:37 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-03-02 17:59:13 +00:00
|
|
|
- uses: actions/checkout@v3
|
2021-06-16 18:37:37 +00:00
|
|
|
with:
|
|
|
|
ref: ${{ github.event.inputs.version }}
|
2022-02-17 01:12:00 +00:00
|
|
|
- name: Install Node 14
|
2022-03-08 02:33:18 +00:00
|
|
|
uses: actions/setup-node@v3
|
2022-02-17 01:12:00 +00:00
|
|
|
with:
|
2022-03-25 18:11:41 +00:00
|
|
|
node-version: '16'
|
2022-02-17 01:12:00 +00:00
|
|
|
- name: Cache node modules
|
2022-03-25 18:11:41 +00:00
|
|
|
uses: actions/cache@v3
|
2022-02-17 01:12:00 +00:00
|
|
|
env:
|
|
|
|
cache-name: cache-node-modules
|
2021-07-14 16:26:38 +00:00
|
|
|
with:
|
2022-02-17 01:12:00 +00:00
|
|
|
path: ~/.npm
|
|
|
|
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
|
|
|
|
- name: npm install with lighthouse cli
|
|
|
|
run: npm install && npm install -g @lhci/cli
|
|
|
|
- name: Run lhci against master to generate baseline
|
|
|
|
run: lhci autorun
|
|
|
|
|