-
Notifications
You must be signed in to change notification settings - Fork 0
133 lines (113 loc) · 4.14 KB
/
pull-requests.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: Inspect Pull Requests
on:
pull_request:
branches: [main]
jobs:
bundlesize:
if: ${{ always() }}
needs: release-bundlesize
runs-on: blacksmith-4vcpu-ubuntu-2204
permissions:
pull-requests: write
strategy:
matrix:
node-version: [22.x]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PNPM
uses: pnpm/action-setup@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: useblacksmith/setup-node@v5
with:
node-version: ${{ matrix.node-version }}
registry-url: "https://registry.npmjs.org"
cache: "pnpm"
- name: Install Dependencies
run: pnpm install
- name: Build packages
run: |
npx lerna run build --scope="@versini/ui-styles"
npx lerna run build --ignore="@versini/example-*" --ignore="@versini/documentation" --ignore="@versini/api" --ignore="@versini/ui-styles"
- name: Run Bundle Size
run: |
npx lerna run stats:pr
npx lerna run stats:report
- name: Add PR Comment
uses: mshick/add-pr-comment@v2
if: always()
with:
refresh-message-position: true
message-path: |
packages/ui-components/tmp/pr-stats.md
packages/ui-fingerprint/tmp/pr-stats.md
packages/ui-form/tmp/pr-stats.md
packages/ui-system/tmp/pr-stats.md
inspect:
if: ${{ always() }}
needs: release-bundlesize
runs-on: blacksmith-4vcpu-ubuntu-2204
strategy:
matrix:
node-version: [22.x]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PNPM
uses: pnpm/action-setup@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: useblacksmith/setup-node@v5
with:
node-version: ${{ matrix.node-version }}
registry-url: "https://registry.npmjs.org"
cache: "pnpm"
- name: Install Dependencies
run: pnpm install
- name: Run Lint and Coverage
run: |
npx lerna run lint --ignore="@versini/documentation" --ignore="@versini/api"
npx lerna run build --scope="@versini/ui-styles"
npx lerna run build --ignore="@versini/documentation" --ignore="@versini/api" --ignore="@versini/ui-styles"
npx lerna run test:coverage --ignore="@versini/documentation" --ignore="@versini/api"
release-bundlesize:
if: github.head_ref == 'release-please--branches--main'
runs-on: blacksmith-4vcpu-ubuntu-2204
permissions:
contents: write
pull-requests: write
strategy:
matrix:
node-version: [22.x]
steps:
# secrets.GITHUB_TOKEN is used by default with "checkout",
# but in this case we are explicitely using a personal
# token with the same permissions (NODE_CLI).
# This is because we want to use the "release-please" action
# that updates and commit files. Other jobs should react to
# these commits and run.
# From GitHub docs: "When you use the repository's GITHUB_TOKEN
# to perform tasks on behalf of the GitHub Actions app, events
# triggered by the GITHUB_TOKEN will not create a new workflow
# run. This prevents you from accidentally creating recursive
# workflow runs.
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.NODE_CLI }}
- name: Setup PNPM
uses: pnpm/action-setup@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: useblacksmith/setup-node@v5
with:
node-version: ${{ matrix.node-version }}
registry-url: "https://registry.npmjs.org"
cache: "pnpm"
- name: Install Dependencies
run: pnpm install
- name: Run Bundle Size For Release PR
run: |
npx lerna run build --scope="@versini/ui-styles"
npx lerna run build --ignore="@versini/example-*" --ignore="@versini/documentation" --ignore="@versini/api" --ignore="@versini/ui-styles"
npx lerna run stats:release
- name: Commit Release Stats to Release PR
uses: stefanzweifel/git-auto-commit-action@v5