-
Notifications
You must be signed in to change notification settings - Fork 8
64 lines (63 loc) · 1.96 KB
/
pr_validation.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Validate Pull Requests
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
pull_request:
branches: ['staging']
types: ['opened', 'edited', 'reopened', 'synchronize']
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build-and-install:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: yarn install and build
run: |
yarn install
yarn build
- name: Archive compiled artifacts
uses: actions/upload-artifact@v3
with:
name: distribution_folder
path: dist
theme-check:
name: Theme Check
runs-on: ubuntu-latest
needs: build-and-install
steps:
- uses: actions/download-artifact@v3
with:
path: dist
- name: Display structure of downloaded files
run: ls -R
working-directory: '.'
- name: Theme Check
uses: shopify/theme-check-action@v1
with:
theme_root: './dist/distribution_folder'
token: ${{ github.token }}
base: main
lighthouse-audit:
name: Lighthouse
runs-on: ubuntu-latest
needs: build-and-install
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v3
with:
path: dist
- name: Display structure of downloaded files
run: ls -R
working-directory: '.'
- name: Lighthouse
uses: shopify/[email protected]
with:
theme_root: './dist/distribution_folder'
store: ${{ secrets.SHOP_STORE }}
access_token: ${{ secrets.SHOP_ACCESS_TOKEN }}
product_handle: ${{ secrets.SHOP_PRODUCT_HANDLE }}
collection_handle: ${{ secrets.SHOP_COLLECTION_HANDLE }}
lhci_github_app_token: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
lhci_min_score_performance: 0.9
lhci_min_score_accessibility: 0.9