generated from refcell/femplate
-
Notifications
You must be signed in to change notification settings - Fork 11
64 lines (57 loc) · 1.97 KB
/
size-check.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: Size Check
on: [push]
jobs:
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Cache compiler installations
id: cache-compiler
uses: actions/cache@v3
with:
path: |
~/.solcx
~/.vvm
key: ${{ runner.os }}-compiler-cache
- name: Setup node.js
uses: actions/setup-node@v1
with:
node-version: "12.x"
- name: Install ganache
run: npm install -g [email protected]
- name: Set up python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Set pip cache directory path
id: pip-cache-dir-path
run: |
echo "PIP_CACHE_DIR=$(pip cache dir)" >> $GITHUB_ENV
- name: Restore pip cache
uses: actions/cache@v3
id: pip-cache
with:
path: |
${PIP_CACHE_DIR}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-dev.txt') }}
restore-keys: |
${{ runner.os }}-pip-${{ hashFiles('**/requirements-dev.txt') }}
${{ runner.os }}-pip-
- name: Install python dependencies
run: pip install -r requirements-dev.txt
- name: Run check-size script
id: check-size
run: |
mkdir -p size-reports-${{ github.run_id }}
./check-size.sh | tee size-reports-${{github.run_id}}/size-report
echo "SIZE_REPORT=$(echo $(cat size-reports-${{github.run_id}}/size-report|tail -1))" >> $GITHUB_OUTPUT
- name: Send size report to Discord
uses: appleboy/discord-action@master
with:
webhook_id: ${{ secrets.DISCORD_ID }}
webhook_token: ${{ secrets.DISCORD_TOKEN }}
username: "Contract Size Reporter"
message: Largest contract size for `${{ github.ref }}` ```${{ steps.check-size.outputs.SIZE_REPORT }}```
timeout-minutes: 3