From 42d08ca81eb0ca62ed1c36309464016290283318 Mon Sep 17 00:00:00 2001 From: HuangYi Date: Mon, 19 Sep 2022 18:02:03 +0800 Subject: [PATCH 1/2] Problem: file changes detection in workflow is problematic Solution: - fix wildcards according the plugin's doc - reformat python --- .github/workflows/build.yml | 8 ++++++-- .github/workflows/linkchecker.yml | 6 ++++-- .github/workflows/lint.yml | 13 +++++++++---- .github/workflows/test.yml | 12 +++++++++--- integration_tests/test_ibc.py | 6 +++--- 5 files changed, 31 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a0bbcbe9f3..8470daee93 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -66,7 +66,9 @@ jobs: gomod2nix: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2.3.4 + - uses: actions/checkout@v3 + with: + fetch-depth: 0 - id: changed-files uses: tj-actions/changed-files@v29.0.2 with: @@ -95,7 +97,9 @@ jobs: contracts: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2.3.4 + - uses: actions/checkout@v3 + with: + fetch-depth: 0 - id: changed-files uses: tj-actions/changed-files@v29.0.2 with: diff --git a/.github/workflows/linkchecker.yml b/.github/workflows/linkchecker.yml index 84ee98639a..ab594a41be 100644 --- a/.github/workflows/linkchecker.yml +++ b/.github/workflows/linkchecker.yml @@ -11,12 +11,14 @@ jobs: markdown-link-check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2.3.4 + - uses: actions/checkout@v3 + with: + fetch-depth: 0 - id: changed-files uses: tj-actions/changed-files@v29.0.2 with: files: | - docs/**.md + docs/**/*.md - uses: gaurav-nelson/github-action-markdown-link-check@1.0.13 if: steps.changed-files.outputs.any_changed == 'true' with: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index fe4fc4509a..e1a68c4715 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -42,14 +42,16 @@ jobs: name: Lint python runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + with: + fetch-depth: 0 - id: changed-files uses: tj-actions/changed-files@v29.0.2 with: files: | **/poetry.lock **/pyproject.toml - **.py + **/*.py - uses: cachix/install-nix-action@v15 if: steps.changed-files.outputs.any_changed == 'true' - uses: cachix/cachix-action@v10 @@ -63,12 +65,15 @@ jobs: name: Lint nix runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + with: + fetch-depth: 0 - id: changed-files uses: tj-actions/changed-files@v29.0.2 with: files: | - **.nix + *.nix + **/*.nix - uses: cachix/install-nix-action@v15 if: steps.changed-files.outputs.any_changed == 'true' - run: nix-shell -I nixpkgs=./nix -p nixpkgs-fmt --run "make lint-nix" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e5c8cf1b41..2002d9ff70 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,13 +16,16 @@ jobs: integration_tests: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + with: + fetch-depth: 0 - id: changed-files uses: tj-actions/changed-files@v29.0.2 with: files: | docs - **.md + *.md + **/*.md - uses: cachix/install-nix-action@v15 if: steps.changed-files.outputs.only_changed == 'false' - uses: cachix/cachix-action@v10 @@ -54,13 +57,16 @@ jobs: os: [macos-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + with: + fetch-depth: 0 - id: changed-files uses: tj-actions/changed-files@v29.0.2 with: files: | docs *.md + **/*.md - uses: cachix/install-nix-action@v15 if: steps.changed-files.outputs.only_changed == 'false' - uses: cachix/cachix-action@v10 diff --git a/integration_tests/test_ibc.py b/integration_tests/test_ibc.py index ffc7511f7c..11193facd1 100644 --- a/integration_tests/test_ibc.py +++ b/integration_tests/test_ibc.py @@ -270,9 +270,9 @@ def test_cronos_transfer_source_tokens(ibc): assert chainmain_receiver_balance == 0 # send to ibc - tx = contract.functions.send_to_ibc_v2(chainmain_receiver, amount, 0, b'').buildTransaction( - {"from": ADDRS["validator"]} - ) + tx = contract.functions.send_to_ibc_v2( + chainmain_receiver, amount, 0, b"" + ).buildTransaction({"from": ADDRS["validator"]}) txreceipt = send_transaction(w3, tx) assert txreceipt.status == 1, "should success" From 0d5166e1e096a847c8f3e203a35b016a3cef4a33 Mon Sep 17 00:00:00 2001 From: HuangYi Date: Mon, 19 Sep 2022 18:08:58 +0800 Subject: [PATCH 2/2] fix py-lint --- integration_tests/test_gravity.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/integration_tests/test_gravity.py b/integration_tests/test_gravity.py index 37ba65690b..4c13ad04de 100644 --- a/integration_tests/test_gravity.py +++ b/integration_tests/test_gravity.py @@ -275,7 +275,7 @@ def local_check_auto_deployment(): # send it back to erc20 tx = crc21_contract.functions.send_to_evm_chain( - ADDRS["validator"], amount, 1, 0, b'' + ADDRS["validator"], amount, 1, 0, b"" ).buildTransaction({"from": ADDRS["community"]}) txreceipt = send_transaction(cronos_w3, tx, KEYS["community"]) # CRC20 emit 3 logs for send_to_evm_chain: @@ -482,7 +482,7 @@ def local_check_auto_deployment(): # send it back to erc20 tx = crc21_contract.functions.send_to_evm_chain( - ADDRS["validator"], amount, 1, 0, b'' + ADDRS["validator"], amount, 1, 0, b"" ).buildTransaction({"from": community}) txreceipt = send_transaction(cronos_w3, tx, KEYS["community"]) # CRC20 emit 3 logs for send_to_evm_chain: @@ -565,7 +565,7 @@ def test_gravity_source_tokens(gravity): print("send to ethereum") tx = contract.functions.send_to_evm_chain( - ethereum_receiver, amount, 1, 0, b'' + ethereum_receiver, amount, 1, 0, b"" ).buildTransaction({"from": ADDRS["validator"]}) txreceipt = send_transaction(w3, tx) assert txreceipt.status == 1, "should success" @@ -651,7 +651,7 @@ def local_check_auto_deployment(): # send it back to blacklisted address tx = crc21_contract.functions.send_to_evm_chain( - ADDRS["signer1"], amount, 1, 0, b'' + ADDRS["signer1"], amount, 1, 0, b"" ).buildTransaction({"from": ADDRS["community"]}) txreceipt = send_transaction(cronos_w3, tx, KEYS["community"]) assert txreceipt.status == 1, "should success"