-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: Evmone Coverage Report | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- 'converted-ethereum-tests.txt' # This triggers the workflow only for changes in file.txt | ||
|
||
jobs: | ||
print-new-lines: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.ref }} # Checks out the PR branch | ||
fetch-depth: 0 # Necessary to fetch all history for diff | ||
|
||
- name: Fetch target branch | ||
run: git fetch origin ${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }} | ||
|
||
- name: Install deps | ||
run: | | ||
echo $(pwd) | ||
sudo apt-get install curl | ||
python3 --version | ||
python3 -m venv ./venv/ | ||
source ./venv/bin/activate | ||
pip install -e . | ||
cd .. | ||
curl -L --output go1.21.8.linux-amd64.tar.gz "https://go.dev/dl/go1.21.8.linux-amd64.tar.gz" | ||
tar -xf go1.21.8.linux-amd64.tar.gz | ||
sudo mv go /usr/local | ||
sudo ln -s /usr/local/go/bin/go /usr/local/bin/go | ||
git clone --depth 1 https://github.com/ethereum/go-ethereum.git | ||
cd go-ethereum | ||
go build ./cmd/evm | ||
cp evm /usr/local/bin | ||
cd .. | ||
curl -L --output solc "https://github.com/ethereum/solidity/releases/download/v0.8.25/solc-static-linux" | ||
sudo mv solc /usr/local/bin | ||
# mkdir testpath | ||
# cd testpath | ||
# git init | ||
# git remote add origin https://github.com/ethereum/tests.git | ||
# git config core.sparseCheckout true | ||
# git sparse-checkout set GeneralStateTests | ||
# git pull origin develop | ||
|
||
|
||
# This command diffs the file and filters in new lines | ||
- name: Parse converted tests from converted-ethereum-tests.txt | ||
run: | | ||
echo "New lines introduced in converted-ethereum-tests.txt:" | ||
lines=$(git diff origin/${{ github.base_ref }} HEAD -- converted-ethereum-tests.txt | grep "^+" | grep -v "^+++") | ||
files=$(echo "$lines" | grep -oP '(?<=\+).+\.json') | ||
for file in $files; do | ||
echo $file | ||
done | ||
# This command diffs the .py scripts introduced by a PR | ||
- name: Parse introduced test sources | ||
run: | | ||
solc --version | ||
python3 -m venv ./venv/ | ||
source ./venv/bin/activate | ||
files=$(git diff --name-status origin/${{ github.base_ref }}...HEAD -- tests/ | grep -E '^[AM]' | grep '\.py$') | ||
echo "Modified or new .py files in tests folder:" | ||
echo "$files" | while read line; do | ||
file=$(echo "$line" | cut -c 3-) | ||
echo $file | ||
fill $file | ||
done | ||