mirror of
https://github.com/nasa/openmct.git
synced 2025-06-02 23:50:49 +00:00
[CI] Enable Per PR Lighthouse CI Execution, Run nightly (#4817)
* [CI] Add lighthouse to our deps to track with dependabot lighthouse ci is still actively maintained and will be following a traditional release model. We should continue to use this package until it's functionality is replaced in playwright * Add lighthouse to dependencies to track with dependabot * Allow lighthouse to be triggered from PRs * Update lighthouse.yml * add lhci scrript * bump to 16 * remove from deps until node 18 * document steps and add caching. Revert to 14 * ignore exit codes * add secret for app * remove env for baseline Co-authored-by: unlikelyzero <jchill2@gmail.com> Co-authored-by: Nikhil <nikhil.k.mandlik@nasa.gov>
This commit is contained in:
parent
af0420361b
commit
3bbc9e1582
90
.github/workflows/lighthouse.yml
vendored
90
.github/workflows/lighthouse.yml
vendored
@ -6,15 +6,95 @@ on:
|
|||||||
description: 'Which branch do you want to test?' # Limited to branch for now
|
description: 'Which branch do you want to test?' # Limited to branch for now
|
||||||
required: false
|
required: false
|
||||||
default: 'master'
|
default: 'master'
|
||||||
|
pull_request:
|
||||||
|
types:
|
||||||
|
- labeled
|
||||||
|
schedule:
|
||||||
|
- cron: '28 21 * * 1-5'
|
||||||
jobs:
|
jobs:
|
||||||
lighthouse:
|
lighthouse-pr:
|
||||||
|
if: ${{ github.event.label.name == 'pr:lighthouse' }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout Master for Baseline
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
ref: master #explicitly checkout master for baseline
|
||||||
|
- name: Install Node 14
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: '14'
|
||||||
|
- 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
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
clean: true
|
||||||
|
- name: Install Node version which is compatible with PR
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
- 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:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Install Node 14
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: '14'
|
||||||
|
- 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 }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.event.inputs.version }}
|
ref: ${{ github.event.inputs.version }}
|
||||||
- uses: actions/setup-node@v2
|
- name: Install Node 14
|
||||||
|
uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: '16'
|
node-version: '14'
|
||||||
- run: npm install && npm install -g @lhci/cli #Don't want to include this in our deps
|
- name: Cache node modules
|
||||||
- run: lhci autorun
|
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
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user