-
Notifications
You must be signed in to change notification settings - Fork 230
200 lines (170 loc) · 5.66 KB
/
Copy pathon-pull-request.yml
File metadata and controls
200 lines (170 loc) · 5.66 KB
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
name: Run checks on Pull Requests
on:
pull_request:
jobs:
changes:
name: Detect Changes
runs-on: ubuntu-latest
outputs:
docs: ${{ steps.filter.outputs.docs }}
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
docs:
- 'docs/**/*.mdx'
enforce_title:
name: Enforce PR Title Format
runs-on: ubuntu-latest
steps:
- name: "Checkout files"
uses: actions/checkout@v3
with:
fetch-depth: "0"
submodules: "recursive"
- name: Setup
uses: ./.github/actions/setup
- name: Use commitlint to check PR title
env:
TITLE: ${{ github.event.pull_request.title }}
run: echo "$TITLE" | pnpm commitlint
lint_docs:
name: Lint Documentation
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.docs == 'true' }}
steps:
- name: "Checkout files"
uses: actions/checkout@v3
with:
fetch-depth: "0"
submodules: "recursive"
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '22'
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Install Vale
run: |
wget -O vale.tar.gz https://github.com/errata-ai/vale/releases/download/v3.12.0/vale_3.12.0_Linux_64-bit.tar.gz
tar -xzf vale.tar.gz
sudo mv vale /usr/local/bin/
vale --version
- name: Run documentation linting
run: pnpm run lint:docs
check_broken_links:
name: Check Broken Links
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.docs == 'true' }}
steps:
- name: "Checkout files"
uses: actions/checkout@v3
with:
fetch-depth: "0"
submodules: "recursive"
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '22'
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Install Lychee
run: |
wget -O lychee.tar.gz https://github.com/lycheeverse/lychee/releases/download/lychee-v0.20.1/lychee-x86_64-unknown-linux-gnu.tar.gz
tar -xzf lychee.tar.gz
sudo mv lychee /usr/local/bin/
lychee --version
- name: Check for broken links
run: pnpm run docs:broken-links
lint:
name: Lint
runs-on: ubuntu-latest
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
steps:
- name: "Checkout files"
uses: actions/checkout@v3
with:
fetch-depth: "0"
submodules: "recursive"
- name: Setup
uses: ./.github/actions/setup
- name: Build eslint plugin
run: |
cd templates/eslint && pnpm run build
- name: Run eslint for errors
run: pnpm run lint:check
build_and_lint_and_test:
name: Build and Test
runs-on: ubuntu-latest
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
API_KEY: ${{ secrets.API_KEY }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
TEST_ALCHEMY_API_KEY: ${{ secrets.TEST_ALCHEMY_API_KEY }}
TEST_PAYMASTER_POLICY_ID: ${{ secrets.TEST_PAYMASTER_POLICY_ID }}
steps:
- name: "Checkout files"
uses: actions/checkout@v3
with:
fetch-depth: "0"
submodules: "recursive"
- name: Free up disk space
run: |
echo "Disk space before cleanup:"
df -h
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo docker image prune --all --force
echo "Disk space after cleanup:"
df -h
- name: Setup
uses: ./.github/actions/setup
# using your own fork url avoids getting rate limited by the public api
# later we'll look at deploying everything we need directly to anvil so
# so we don't need a fork url
- name: Conditionally set fork url
if: ${{ env.API_KEY != '' }}
run: echo "VITEST_SEPOLIA_FORK_URL=https://eth-sepolia.g.alchemy.com/v2/${{ env.API_KEY }}" >> $GITHUB_ENV
- name: Set up Rundler
uses: jaxxstorm/action-install-gh-release@v1.12.0
with:
repo: alchemyplatform/rundler
platform: linux
tag: v0.11.0
cache: enable
- name: Build Libraries
env:
API_KEY: ${{ secrets.API_KEY }}
JAVA_OPTS: "-XX:MaxHeapSize=6g"
run: pnpm run build:libs
- name: Unit Test
run: ./scripts/run-affected-tests.sh "${{ github.event.pull_request.base.ref }}"
- name: Typecheck Test
run: pnpm run test:typecheck
- name: Check generated API code is up to date
run: |
pnpm run generate
git diff --exit-code packages/*/src/generated packages/api-codegen/specs || \
(echo "::error::Generated API code is out of date or spec snapshots were hand-edited. Run 'pnpm generate' and commit the changes." && exit 1)
- name: Check SDK reference docs are up to date
run: |
pnpm run docs:sdk
pnpm run lint:write
git diff --exit-code docs/pages/reference/ || \
(echo "::error::SDK reference docs are out of date. Run 'pnpm run docs:sdk' and commit the changes." && exit 1)