Add deploy previews with Lighthouse tests (#159)
This commit is contained in:
parent
2c47a49260
commit
04dfc6e659
2 changed files with 53 additions and 16 deletions
51
.github/workflows/check-app-quality.yml
vendored
Normal file
51
.github/workflows/check-app-quality.yml
vendored
Normal file
|
|
@ -0,0 +1,51 @@
|
||||||
|
name: Check App Quality
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
preview:
|
||||||
|
name: Create deploy preview
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
deploy-url: ${{ steps.netlify.outputs.deploy-url }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: 16
|
||||||
|
cache: npm
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
- name: Run Astro build command
|
||||||
|
run: npm run build
|
||||||
|
- name: Deploy to Netlify
|
||||||
|
id: netlify
|
||||||
|
uses: nwtgck/actions-netlify@v2
|
||||||
|
with:
|
||||||
|
publish-dir: dist
|
||||||
|
production-branch: main
|
||||||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
alias: deploy-preview-${{ github.event.number }}
|
||||||
|
env:
|
||||||
|
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
||||||
|
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
|
||||||
|
timeout-minutes: 1
|
||||||
|
|
||||||
|
lighthouse:
|
||||||
|
name: Run Lighthouse tests
|
||||||
|
needs: preview
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Lighthouse
|
||||||
|
uses: foo-software/lighthouse-check-action@master
|
||||||
|
with:
|
||||||
|
urls: ${{ needs.preview.outputs.deploy-url }}
|
||||||
|
gitAuthor: ${{ github.actor }}
|
||||||
|
gitBranch: ${{ github.ref }}
|
||||||
|
gitHubAccessToken: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
device: all
|
||||||
|
prCommentEnabled: true
|
||||||
|
prCommentSaveOld: false
|
||||||
18
.github/workflows/check-code-quality.yml
vendored
18
.github/workflows/check-code-quality.yml
vendored
|
|
@ -15,7 +15,7 @@ jobs:
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: 16
|
||||||
cache: 'npm'
|
cache: npm
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
- name: Run Prettier
|
- name: Run Prettier
|
||||||
|
|
@ -29,22 +29,8 @@ jobs:
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: 16
|
||||||
cache: 'npm'
|
cache: npm
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
- name: Run TypeScript types check
|
- name: Run TypeScript types check
|
||||||
run: npm run ts:check
|
run: npm run ts:check
|
||||||
|
|
||||||
build:
|
|
||||||
name: Build project
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: 16
|
|
||||||
cache: 'npm'
|
|
||||||
- name: Install dependencies
|
|
||||||
run: npm ci
|
|
||||||
- name: Run Astro build command
|
|
||||||
run: npm run build
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue