mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-10-27 13:05:48 -04:00
Update ci.yml
This commit is contained in:
57
.github/workflows/ci.yml
vendored
57
.github/workflows/ci.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
name: CI
|
name: Run tests
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -7,30 +7,48 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: "!contains(github.event.head_commit.message, '[skip ci]')"
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 1
|
||||||
|
- uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: 12.x
|
||||||
|
# https://github.com/actions/cache/blob/master/examples.md#node---yarn
|
||||||
|
# https://github.com/actions/cache/issues/60
|
||||||
|
- name: Get yarn cache location
|
||||||
|
id: yarn-cache
|
||||||
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||||
|
- uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
path: ${{ steps.yarn-cache.outputs.dir }}
|
||||||
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-yarn-
|
||||||
|
- run: yarn install --no-ignore-optional --frozen-lockfile
|
||||||
|
- run: yarn lint
|
||||||
|
|
||||||
|
lighthouse:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
# "[skip ci]" also causes Netlify to skip, so these are automatically in harmony
|
# "[skip ci]" also causes Netlify to skip, so these are automatically in harmony
|
||||||
# https://docs.netlify.com/site-deploys/manage-deploys/#skip-a-deploy
|
# https://docs.netlify.com/site-deploys/manage-deploys/#skip-a-deploy
|
||||||
if: "!contains(github.event.head_commit.message, '[skip ci]')"
|
if: "!contains(github.event.head_commit.message, '[skip ci]')"
|
||||||
env:
|
|
||||||
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
|
|
||||||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
|
||||||
steps:
|
|
||||||
- name: Wait for Netlify
|
|
||||||
run: npx netlify-cli watch
|
|
||||||
|
|
||||||
lighthouse:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: deploy
|
|
||||||
env:
|
|
||||||
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 1
|
||||||
- uses: actions/setup-node@v1
|
- uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: 12.x
|
node-version: 12.x
|
||||||
- name: Install LHCI
|
- run: npm install -g netlify-cli @lhci/cli
|
||||||
run: npm install -g @lhci/cli
|
- name: Wait for Netlify
|
||||||
|
run: netlify watch
|
||||||
|
env:
|
||||||
|
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
|
||||||
|
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
||||||
- name: Audit deploy preview
|
- name: Audit deploy preview
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
@@ -39,6 +57,8 @@ jobs:
|
|||||||
--collect.url=https://deploy-preview-${{ github.event.number }}--jakejarvis.netlify.com/ \
|
--collect.url=https://deploy-preview-${{ github.event.number }}--jakejarvis.netlify.com/ \
|
||||||
--collect.url=https://deploy-preview-${{ github.event.number }}--jakejarvis.netlify.com/notes/how-to-pull-request-fork-github/ \
|
--collect.url=https://deploy-preview-${{ github.event.number }}--jakejarvis.netlify.com/notes/how-to-pull-request-fork-github/ \
|
||||||
--collect.url=https://deploy-preview-${{ github.event.number }}--jakejarvis.netlify.com/notes/how-to-pull-request-fork-github/amp.html
|
--collect.url=https://deploy-preview-${{ github.event.number }}--jakejarvis.netlify.com/notes/how-to-pull-request-fork-github/amp.html
|
||||||
|
env:
|
||||||
|
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
|
||||||
- name: Audit jarv.is
|
- name: Audit jarv.is
|
||||||
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
@@ -47,6 +67,8 @@ jobs:
|
|||||||
--collect.url=https://jarv.is/ \
|
--collect.url=https://jarv.is/ \
|
||||||
--collect.url=https://jarv.is/notes/how-to-pull-request-fork-github/ \
|
--collect.url=https://jarv.is/notes/how-to-pull-request-fork-github/ \
|
||||||
--collect.url=https://jarv.is/notes/how-to-pull-request-fork-github/amp.html
|
--collect.url=https://jarv.is/notes/how-to-pull-request-fork-github/amp.html
|
||||||
|
env:
|
||||||
|
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
|
||||||
- name: Upload results as artifact
|
- name: Upload results as artifact
|
||||||
uses: actions/upload-artifact@v1
|
uses: actions/upload-artifact@v1
|
||||||
with:
|
with:
|
||||||
@@ -83,9 +105,6 @@ jobs:
|
|||||||
run: yarn install --no-ignore-optional --frozen-lockfile
|
run: yarn install --no-ignore-optional --frozen-lockfile
|
||||||
- name: Build site preview
|
- name: Build site preview
|
||||||
run: yarn build:preview
|
run: yarn build:preview
|
||||||
- name: Lint
|
|
||||||
continue-on-error: true
|
|
||||||
run: yarn lint
|
|
||||||
- name: Percy snapshots
|
- name: Percy snapshots
|
||||||
uses: percy/snapshot-action@v0.1.0
|
uses: percy/snapshot-action@v0.1.0
|
||||||
env:
|
env:
|
||||||
|
|||||||
Reference in New Issue
Block a user