Repository navigation
72 lines (59 loc) · 2.01 KB
/
Copy pathbytecode-size.yml
File metadata and controls
72 lines (59 loc) · 2.01 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
name: Bytecode Size Report
on:
pull_request:
branches: [master]
permissions:
contents: read
env:
PYTHON_VERSION: "3.12"
jobs:
bytecode-size:
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Checkout merge commit
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: refs/pull/${{ github.event.pull_request.number }}/merge
path: head
fetch-depth: 0
fetch-tags: true
persist-credentials: false
- name: Checkout base
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.base_ref }}
path: base
fetch-depth: 0
fetch-tags: true
persist-credentials: false
- name: Copy scripts to base
run: cp -r head/.github/scripts base/.github/
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install vyper (base)
working-directory: base
run: pip install .
- name: Measure base bytecode sizes
working-directory: base
run: python .github/scripts/measure_bytecode.py > ../base-sizes.json
- name: Install vyper (merge)
working-directory: head
run: pip install .
- name: Measure merge bytecode sizes
working-directory: head
run: python .github/scripts/measure_bytecode.py > ../head-sizes.json
- name: Generate report
run: |
python3 head/.github/scripts/compare_bytecode.py base-sizes.json head-sizes.json > report.md
cat report.md >> "$GITHUB_STEP_SUMMARY"
- name: Upload size data
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: bytecode-size-report
path: |
base-sizes.json
head-sizes.json
report.md