From 33c9ee41c5826b8df6aadcf4c576b26082a4db28 Mon Sep 17 00:00:00 2001 From: kirbygit Date: Wed, 1 Jul 2020 10:17:04 -0700 Subject: [PATCH] Initial push of lighthouse-ci & lighthous-ci-action --- .github/workflows/lighthouse-ci-action.yml | 27 ++++++++++ .github/workflows/lighthouse-ci.yml | 62 ++++++++++++++++++++++ budget.json | 16 ++++++ lighthouserc.js | 8 +++ 4 files changed, 113 insertions(+) create mode 100644 .github/workflows/lighthouse-ci-action.yml create mode 100644 .github/workflows/lighthouse-ci.yml create mode 100644 budget.json create mode 100644 lighthouserc.js diff --git a/.github/workflows/lighthouse-ci-action.yml b/.github/workflows/lighthouse-ci-action.yml new file mode 100644 index 0000000000..ac3dc6ee41 --- /dev/null +++ b/.github/workflows/lighthouse-ci-action.yml @@ -0,0 +1,27 @@ +# TODO: LIGHTHOUSE-CI-ACTION +name: Lighthouse CI +on: [push] + +jobs: + lighthouse: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + - run: npm install && npm install -g @lhci/cli@0.4.x + - run: npm run build + - run: lhci autorun --upload.target=temporary-public-storage + - name: Audit URL's using Lighthouse + uses: treosh/lighthouse-ci-action@v3 + with: + node-version: 10.x + outputDirectory: /tmp/artifacts + urls: 'https://docsify.js.org/#/' # URL to audit using Lighthouse + budgetPath: .budget.json # test performance budgets + uploadArtifacts: true # save results as an action artifacts + temporaryPublicStorage: true # upload whitehouse report to the temporary storage + - name: Upload artifacts + uses: actions/upload-artifact@master + with: + name: Lighthouse reports + path: /tmp/artifacts \ No newline at end of file diff --git a/.github/workflows/lighthouse-ci.yml b/.github/workflows/lighthouse-ci.yml new file mode 100644 index 0000000000..3236dc9d7e --- /dev/null +++ b/.github/workflows/lighthouse-ci.yml @@ -0,0 +1,62 @@ +# TODO: LIGHTHOUSE-CI +# name: Lighthouse CI +# on: [push] + +# jobs: +# lighthouse: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v2 +# - uses: actions/setup-node@v1 +# - run: npm install && npm install -g @lhci/cli@0.4.x +# - run: npm run build +# - run: lhci autorun --upload.target=temporary-public-storage +# - name: Audit URL's using Lighthouse +# uses: treosh/lighthouse-ci-action@v3 +# with: +# node-version: 10.x +# outputDirectory: /tmp/artifacts +# urls: 'https://docsify.js.org/#/' # URL to audit using Lighthouse +# budgetPath: .budget.json # test performance budgets +# uploadArtifacts: true # save results as an action artifacts +# temporaryPublicStorage: true # upload whitehouse report to the temporary storage +# - name: Upload artifacts +# uses: actions/upload-artifact@master +# with: +# name: Lighthouse reports +# path: /tmp/artifacts + +name: Lighthouse CI + +on: + push: + branches: + - master + - develop + pull_request: + branches: + - master + - develop + +jobs: + build: + runs-on: ubuntu-16.04 + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [10.x, 12.x, 13.x] + + steps: + - uses: actions/checkout@v1 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: npm install, build + run: | + npm install + npm run build + - name: run Lighthouse CI + run: | + npm install -g @lhci/cli@0.4.x + lhci autorun \ No newline at end of file diff --git a/budget.json b/budget.json new file mode 100644 index 0000000000..8e93f5a285 --- /dev/null +++ b/budget.json @@ -0,0 +1,16 @@ +// TODO: LIGHTHOUSE-CI +[ + { + "path": "/*", + "resourceSizes": [ + { + "resourceType": "document", + "budget": 18 + }, + { + "resourceType": "total", + "budget": 200 + } + ] + } +] \ No newline at end of file diff --git a/lighthouserc.js b/lighthouserc.js new file mode 100644 index 0000000000..873494fed2 --- /dev/null +++ b/lighthouserc.js @@ -0,0 +1,8 @@ +// TODO: LIGHTHOUSE-CI +module.exports = { + ci: { + upload: { + target: 'temporary-public-storage', + }, + }, +};