-
Notifications
You must be signed in to change notification settings - Fork 409
105 lines (83 loc) · 3.02 KB
/
t-bytecode-compare.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
name: Release bytecode
on: pull_request
jobs:
generate:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- platform: emscripten-wasm32
os: ubuntu-latest
- platform: emscripten-asmjs
os: ubuntu-latest
- platform: linux-amd64
os: ubuntu-latest
- platform: macosx-amd64
os: macos-latest
# TODO: Run checks on Windows binaries too
env:
PLATFORM: ${{ matrix.platform }}
steps:
# TODO: remove when https://github.com/axic/keccakjs/issues/13 got fixed
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Remove unused software to free up space
# macOS runners apparently have > 70 GB free so it's only needed on Ubuntu
if: "env.PLATFORM != 'macosx-amd64'"
run: |
# These are quick to delete and large enough to make a difference
rm -rf /usr/share/swift/ # 1.3 GB in 80 subdirs
rm -rf /usr/local/lib/android/sdk/build-tools/ # 2.1 GB in 450 subdirs
rm -rf /usr/share/dotnet/shared/ # 5.3 GB in 350 subdirs
rm -rf /usr/local/lib/android/sdk/ndk/ # 7.6 GB in 1500 subdirs
- uses: actions/setup-python@v3
with:
# Use the latest minor release of Python 3. prepare_report.py requires Python >= 3.7
python-version: '3.x'
- uses: actions/checkout@v3
with:
repository: 'ethereum/solidity'
path: 'solidity/'
# bytecode_reports_for_modified_binaries.sh requires access to a working copy with full history
fetch-depth: 0
- uses: actions/checkout@v3
with:
ref: ${{ env.GITHUB_REF }}
path: 'solc-bin/'
# We need more than just a single revision to be able to use diff
fetch-depth: 0
- name: Generate reports from matching release binaries
run: |
base_dir="$PWD"
mkdir reports/
cd reports/
"${base_dir}/solidity/scripts/solc-bin/bytecode_reports_for_modified_binaries.sh" \
"$PLATFORM" \
"origin/${{ github.base_ref }}" \
"origin/${GITHUB_HEAD_REF}" \
"$base_dir/solc-bin" \
"$base_dir/solidity"
- name: Upload reports
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.platform }}
path: reports/*
compare:
runs-on: ubuntu-latest
needs: generate
steps:
- uses: actions/checkout@v3
with:
repository: 'ethereum/solidity'
path: 'solidity/'
- name: Download all artifacts
uses: actions/download-artifact@v3
with:
path: reports/
- name: Compare
run: |
# This can happen if the PR does not touch any release binaries.
[[ -d reports/ ]] || { echo "No reports found."; exit 0; }
cd reports/
../solidity/scripts/solc-bin/compare_bytecode_reports.sh