-
Notifications
You must be signed in to change notification settings - Fork 7
50 lines (50 loc) · 1.58 KB
/
pull_request.yaml
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
name: Check the source code
on:
pull_request:
jobs:
test:
name: Check the source code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
# unable to use yarn in actions/setup-node@v3 https://github.com/actions/setup-node/issues/182#issuecomment-966885975
- name: Install Yarn
run: npm install -g yarn
- uses: actions/setup-node@v3
with:
node-version: '16'
cache: yarn
- name: Setup dotenv
# Test account's fixed private key in hardhat local node
run: |
echo 'PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80' > .env
echo 'STAGING_ALCHEMY_KEY=' >> .env
echo 'PROD_ALCHEMY_KEY=' >> .env
- name: Install packages
run: yarn
- name: Checkout Base Branch
uses: actions/checkout@v3
with:
ref: ${{ github.base_ref }}
clean: false
- name: Check Base Contract Size
run: npx hardhat size-contracts
- name: Checkout Target Branch
uses: actions/checkout@v3
with:
clean: false
- name: Lint
run: yarn lint
- name: Test
run: yarn test
- name: Check Target Contract Size
run: echo "\`\`\`\n $(npx hardhat size-contracts)" > ./comments
- name: Post comments
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
URL: ${{ github.event.pull_request.html_url }}
run:
gh pr comment -F ./comments "${URL}"