From d767439d3d91eab6d9edac19f7feb433129ea160 Mon Sep 17 00:00:00 2001 From: feliam Date: Mon, 23 Mar 2020 16:38:37 -0300 Subject: [PATCH 01/10] Github actions for tests --- .github/ISSUE_TEMPLATE.md | 10 +++++++ .github/workflows/main.yml | 59 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/workflows/main.yml diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..ca387b3 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,10 @@ +### pyvmasm version + + +### Python version + + +### Summary of the problem + + + diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..e2aa597 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,59 @@ +name: CI + +on: + push: + branches: [ dev-gitactions] + pull_request: + branches: [ master ] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Set up Python 3.6 + uses: actions/setup-python@v1 + with: + python-version: 3.6 + - name: Lint + if: github.event_name == 'pull_request' + env: + BASE_SHA: ${{ github.event.pull_request.base.sha }} + HEAD_SHA: ${{ github.event.pull_request.head.sha }} + run: | + pip install -e .[lint] + black --version + git diff --name-only $BASE_SHA..$HEAD_SHA | python scripts/pyfile_exists.py | xargs black --diff --check + mypy --version + mypy + + test37: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + - name: Run Tests 37 + run: | + pytest --cov=pyevmasm -n auto "tests/" + #coverage xml + + test27: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python 2.7 + uses: actions/setup-python@v1 + with: + python-version: 2.7 + - name: Run Tests 27 + run: | + pytest --cov=pyevmasm -n auto "tests/" + #coverage xml + From 1f653cabaaef3be4915ab2c1b0c677cf8ea6a114 Mon Sep 17 00:00:00 2001 From: feliam Date: Mon, 23 Mar 2020 16:40:57 -0300 Subject: [PATCH 02/10] Use unittests for a starter --- .github/workflows/main.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e2aa597..57b2323 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -39,8 +39,7 @@ jobs: python-version: 3.7 - name: Run Tests 37 run: | - pytest --cov=pyevmasm -n auto "tests/" - #coverage xml + python -m unittest discover "tests/" test27: runs-on: ubuntu-latest @@ -54,6 +53,5 @@ jobs: python-version: 2.7 - name: Run Tests 27 run: | - pytest --cov=pyevmasm -n auto "tests/" - #coverage xml + python -m unittest discover "tests/" From 06e41500c5a5c28ed338f9c872845eb671bba0a0 Mon Sep 17 00:00:00 2001 From: feliam Date: Mon, 23 Mar 2020 16:45:44 -0300 Subject: [PATCH 03/10] Install deps --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 57b2323..7893939 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -39,6 +39,7 @@ jobs: python-version: 3.7 - name: Run Tests 37 run: | + python setup.py install python -m unittest discover "tests/" test27: @@ -53,5 +54,6 @@ jobs: python-version: 2.7 - name: Run Tests 27 run: | + python setup.py install python -m unittest discover "tests/" From b94e0b05338f18c7c79a7f2def2cea093bf4b41d Mon Sep 17 00:00:00 2001 From: feliam Date: Mon, 23 Mar 2020 16:58:59 -0300 Subject: [PATCH 04/10] Keep testting the tests --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7893939..f7de5d7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,7 +2,7 @@ name: CI on: push: - branches: [ dev-gitactions] + branches: [ dev-gitactions, dev-fix] pull_request: branches: [ master ] From ea3f42d5c50b7dfed95bf6c63a3257f82f8df260 Mon Sep 17 00:00:00 2001 From: feliam Date: Mon, 23 Mar 2020 17:14:43 -0300 Subject: [PATCH 05/10] Add badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index db89346..586f413 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # pyevmasm +![CI](https://github.com/crytic/pyevmasm/workflows/CI/badge.svg) [![PyPI version](https://badge.fury.io/py/pyevmasm.svg)](https://badge.fury.io/py/pyevmasm) [![Slack Status](https://empireslacking.herokuapp.com/badge.svg)](https://empireslacking.herokuapp.com) From d0285c167653338a5338e1b5b13ad5bdcd3c674d Mon Sep 17 00:00:00 2001 From: feliam Date: Mon, 23 Mar 2020 17:38:32 -0300 Subject: [PATCH 06/10] lints --- .github/workflows/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f7de5d7..b3034a3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,7 +21,9 @@ jobs: BASE_SHA: ${{ github.event.pull_request.base.sha }} HEAD_SHA: ${{ github.event.pull_request.head.sha }} run: | - pip install -e .[lint] + pip install black + pip install mypy + python setup.py install black --version git diff --name-only $BASE_SHA..$HEAD_SHA | python scripts/pyfile_exists.py | xargs black --diff --check mypy --version From 9721cb91e70064cda1a64b6440a0911dba14d6c2 Mon Sep 17 00:00:00 2001 From: feliam Date: Mon, 23 Mar 2020 17:41:18 -0300 Subject: [PATCH 07/10] lints --- pyevmasm/evmasm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyevmasm/evmasm.py b/pyevmasm/evmasm.py index 7056f41..11536ba 100644 --- a/pyevmasm/evmasm.py +++ b/pyevmasm/evmasm.py @@ -5,7 +5,7 @@ from future.builtins import next, bytes # type: ignore import copy -DEFAULT_FORK = "petersburg" +DEFAULT_FORK = "istanbul" """ Example use:: From 356f6a711bdbf03a11683af766f2aa0899f0f699 Mon Sep 17 00:00:00 2001 From: feliam Date: Mon, 23 Mar 2020 18:03:37 -0300 Subject: [PATCH 08/10] badge and lint --- .github/workflows/main.yml | 2 +- README.md | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b3034a3..8d0da3d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,7 +25,7 @@ jobs: pip install mypy python setup.py install black --version - git diff --name-only $BASE_SHA..$HEAD_SHA | python scripts/pyfile_exists.py | xargs black --diff --check + git diff --name-only $BASE_SHA..$HEAD_SHA | grep "*.py" | xargs black --diff --check mypy --version mypy diff --git a/README.md b/README.md index 586f413..98b5c8f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # pyevmasm -![CI](https://github.com/crytic/pyevmasm/workflows/CI/badge.svg) +[![Build Status](https://github.com/crytic/pyevmasm/workflows/CI/badge.svg)](https://github.com/crytic/pyevmasm/actions?query=workflow%3ACI) + [![PyPI version](https://badge.fury.io/py/pyevmasm.svg)](https://badge.fury.io/py/pyevmasm) [![Slack Status](https://empireslacking.herokuapp.com/badge.svg)](https://empireslacking.herokuapp.com) From 96b7a95640c229f5ef34121b11ea2d84c66821b7 Mon Sep 17 00:00:00 2001 From: feliam Date: Mon, 23 Mar 2020 18:12:13 -0300 Subject: [PATCH 09/10] badge and lint --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8d0da3d..5082295 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,7 +27,7 @@ jobs: black --version git diff --name-only $BASE_SHA..$HEAD_SHA | grep "*.py" | xargs black --diff --check mypy --version - mypy + mypy pyevmasm test37: runs-on: ubuntu-latest From c8b3bbb4d4bf0a53108fb7d481f9e58fb9956018 Mon Sep 17 00:00:00 2001 From: feliam Date: Mon, 23 Mar 2020 18:25:22 -0300 Subject: [PATCH 10/10] lint master --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5082295..4befc96 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,7 +2,7 @@ name: CI on: push: - branches: [ dev-gitactions, dev-fix] + branches: [ master ] pull_request: branches: [ master ]