-
Notifications
You must be signed in to change notification settings - Fork 486
93 lines (89 loc) · 3.17 KB
/
main.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: CI
on:
pull_request:
branches: ['master', 'stable']
push:
branches: ['master', 'stable']
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install Dependencies
run: yarn install
- name: Lint
run: yarn lint
- name: Types
run: yarn lint:typescript
- name: Format
run: yarn format:check
- name: Verify Dependencies
run: yarn checkDeps
- name: Run Jest
env:
BROWSERSLIST_CONFIG: './packages/browserslist-config-clay/config'
BROWSERSLIST_DISABLE_CACHE: 1
CI: true
run: yarn test --coverage
- name: Push to Coveralls
if: ${{ success() }}
uses: coverallsapp/[email protected]
with:
path-to-lcov: ./coverage/lcov.info
github-token: ${{ secrets.GITHUB_TOKEN }}
stats:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Fetch and Diff
id: diff
run: |
git fetch --no-tags --depth=1 origin ${{ github.event.pull_request.base.sha }}
echo "##[set-output name=packages;]$(git diff --exit-code ${{ github.event.pull_request.base.sha }} 'packages/*')"
- name: Checkout BASE
if: ${{ steps.diff.outputs.packages }}
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.base.sha }}
- name: Generate Build Info
if: ${{ steps.diff.outputs.packages }}
run: |
yarn cache clean
yarn install
yarn build
yarn genBuildSize
- name: Clean directory
if: ${{ steps.diff.outputs.packages }}
run: |
git clean -ffdx --exclude /tmp
git reset --hard HEAD
- name: Checkout HEAD
if: ${{ steps.diff.outputs.packages }}
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
clean: false
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Generate Bundle Size Table
if: ${{ steps.diff.outputs.packages }}
run: |
yarn cache clean
yarn install
yarn build
yarn genBuildSize:compare
- name: Generate Total Size
if: ${{ steps.diff.outputs.packages }}
run: |
yarn run sizeLimit