From ca86161e377b26eb96cde7d4189f97309e2d285d Mon Sep 17 00:00:00 2001 From: Francisco Krause Arnim Date: Mon, 13 Nov 2023 14:46:21 -0300 Subject: [PATCH 01/16] Add test-precompiles first test iteration --- .github/workflows/ci.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b7c393ed..34a9d2c0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -61,3 +61,13 @@ jobs: - name: "Build precompiles" run: make build-precompiles + test-precompiles: + name: "Run tests for precompiles" + runs-on: ubuntu-latest + steps: + - name: Run Era Test Node + uses: dutterbutter/era-test-node-action@latest + + - name: Run tests + working-directory: ./tests + run: cargo test From c2a35c16523f56c9b9d9c672c13d641a6b42c1bd Mon Sep 17 00:00:00 2001 From: Francisco Krause Arnim Date: Mon, 13 Nov 2023 14:48:06 -0300 Subject: [PATCH 02/16] Fix path --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 34a9d2c0..0d625eb2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -69,5 +69,5 @@ jobs: uses: dutterbutter/era-test-node-action@latest - name: Run tests - working-directory: ./tests + working-directory: tests run: cargo test From 6c13c89be90d99d1e9e654e3c7d25967774c2a3f Mon Sep 17 00:00:00 2001 From: Francisco Krause Arnim Date: Mon, 13 Nov 2023 14:50:30 -0300 Subject: [PATCH 03/16] Debug ls --- .github/workflows/ci.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0d625eb2..c2093640 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -69,5 +69,4 @@ jobs: uses: dutterbutter/era-test-node-action@latest - name: Run tests - working-directory: tests - run: cargo test + run: ls && cargo test From 3c856038e5f73384c1189000015eae09d85ca7e4 Mon Sep 17 00:00:00 2001 From: Francisco Krause Arnim Date: Mon, 13 Nov 2023 14:52:36 -0300 Subject: [PATCH 04/16] Use cd --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c2093640..345cb15b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -69,4 +69,4 @@ jobs: uses: dutterbutter/era-test-node-action@latest - name: Run tests - run: ls && cargo test + run: cd tests && cargo test From 462d6368bdf8d210ce20d05f467a8a29832abc53 Mon Sep 17 00:00:00 2001 From: Francisco Krause Arnim Date: Mon, 13 Nov 2023 14:54:04 -0300 Subject: [PATCH 05/16] Use working-directory --- .github/workflows/ci.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 345cb15b..34a9d2c0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -69,4 +69,5 @@ jobs: uses: dutterbutter/era-test-node-action@latest - name: Run tests - run: cd tests && cargo test + working-directory: ./tests + run: cargo test From b8fdbe786e4083fa0c4436ae86366d57399b29e7 Mon Sep 17 00:00:00 2001 From: Francisco Krause Arnim Date: Mon, 13 Nov 2023 14:55:09 -0300 Subject: [PATCH 06/16] Use working directory without dot --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 34a9d2c0..0d625eb2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -69,5 +69,5 @@ jobs: uses: dutterbutter/era-test-node-action@latest - name: Run tests - working-directory: ./tests + working-directory: tests run: cargo test From ddb51ca60f13cd54577473367f3020da9aac2232 Mon Sep 17 00:00:00 2001 From: Francisco Krause Arnim Date: Mon, 13 Nov 2023 14:55:44 -0300 Subject: [PATCH 07/16] Use full path --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0d625eb2..723aed5d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -69,5 +69,5 @@ jobs: uses: dutterbutter/era-test-node-action@latest - name: Run tests - working-directory: tests + working-directory: ./zksync_era_precompiles/tests run: cargo test From 0d9658e56c3b05f779cc832ac0d51b9ba843476c Mon Sep 17 00:00:00 2001 From: Francisco Krause Arnim Date: Mon, 13 Nov 2023 14:57:22 -0300 Subject: [PATCH 08/16] Add checkout to step --- .github/workflows/ci.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 723aed5d..ed21448c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -65,9 +65,12 @@ jobs: name: "Run tests for precompiles" runs-on: ubuntu-latest steps: + - name: "Checkout" + uses: actions/checkout@v3 + - name: Run Era Test Node uses: dutterbutter/era-test-node-action@latest - name: Run tests - working-directory: ./zksync_era_precompiles/tests + working-directory: tests run: cargo test From dc0c464acdce5cba2b4b58ce1a3a673439cbca6f Mon Sep 17 00:00:00 2001 From: Francisco Krause Arnim Date: Mon, 13 Nov 2023 15:24:25 -0300 Subject: [PATCH 09/16] Wait for local build test node --- .github/workflows/ci.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ed21448c..1b17994c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -69,7 +69,17 @@ jobs: uses: actions/checkout@v3 - name: Run Era Test Node - uses: dutterbutter/era-test-node-action@latest + run: | + make run & + - name: Wait for era test node to build + run: | + PORT=8011 + nc -l -p $PORT & + NC_PID=$! + timeout 600 tail -f /dev/null + kill $NC_PID + echo "Timeout: Test node did not start ..." + - name: Run tests working-directory: tests From 73d717c8065c74c73dfdd35cf4ccef3cc761723e Mon Sep 17 00:00:00 2001 From: Francisco Krause Arnim Date: Mon, 13 Nov 2023 15:25:47 -0300 Subject: [PATCH 10/16] Add setup test --- .github/workflows/ci.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1b17994c..01aa0d99 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -70,7 +70,9 @@ jobs: - name: Run Era Test Node run: | + make setup make run & + - name: Wait for era test node to build run: | PORT=8011 From a2ce2528fe8b14ac6f2bc5d7a9c5415af8a12a9f Mon Sep 17 00:00:00 2001 From: Francisco Krause Arnim Date: Mon, 13 Nov 2023 15:34:04 -0300 Subject: [PATCH 11/16] Do not disown running test node to see how long it takes --- .github/workflows/ci.yaml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 01aa0d99..32883d67 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -71,16 +71,16 @@ jobs: - name: Run Era Test Node run: | make setup - make run & - - - name: Wait for era test node to build - run: | - PORT=8011 - nc -l -p $PORT & - NC_PID=$! - timeout 600 tail -f /dev/null - kill $NC_PID - echo "Timeout: Test node did not start ..." + make run + + # - name: Wait for era test node to build + # run: | + # PORT=8011 + # nc -l -p $PORT & + # NC_PID=$! + # timeout 600 tail -f /dev/null + # kill $NC_PID + # echo "Timeout: Test node did not start ..." - name: Run tests From 0608d033ae48a8cdafdf0256995cac47c07d83f3 Mon Sep 17 00:00:00 2001 From: Francisco Krause Arnim Date: Mon, 13 Nov 2023 15:39:34 -0300 Subject: [PATCH 12/16] Add nightly for node compile --- .github/workflows/ci.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 32883d67..f280f11f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -68,6 +68,9 @@ jobs: - name: "Checkout" uses: actions/checkout@v3 + - name: Setup rust nightly + uses: dtolnay/rust-toolchain@nightly + - name: Run Era Test Node run: | make setup From 9b96039bd8f85347f2689588c3f2aa1dffce2613 Mon Sep 17 00:00:00 2001 From: Francisco Krause Arnim Date: Mon, 13 Nov 2023 15:57:18 -0300 Subject: [PATCH 13/16] Add step to only compile test node --- .github/workflows/ci.yaml | 8 ++++---- Makefile | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f280f11f..17a83d53 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -71,10 +71,10 @@ jobs: - name: Setup rust nightly uses: dtolnay/rust-toolchain@nightly - - name: Run Era Test Node - run: | - make setup - make run + - name: Setup project + run: make setup + - name: Build test node + run: build-test-node # - name: Wait for era test node to build # run: | diff --git a/Makefile b/Makefile index ca70b4e0..c133062f 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,9 @@ copy-precompiles: build-precompiles: copy-precompiles cd submodules/era-test-node && make build-precompiles +build-test-node: + cd submodules/era-test-node && cargo +nightly build + run: build-precompiles cd submodules/era-test-node && cargo +nightly run -- --show-calls=all --resolve-hashes --show-gas-details=all run From 97d52570a9af3c783d096460642c5d59ffde2c27 Mon Sep 17 00:00:00 2001 From: Francisco Krause Arnim Date: Mon, 13 Nov 2023 16:01:40 -0300 Subject: [PATCH 14/16] Fix test node step --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 17a83d53..fe49ee88 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -74,7 +74,7 @@ jobs: - name: Setup project run: make setup - name: Build test node - run: build-test-node + run: make build-test-node # - name: Wait for era test node to build # run: | From 24739bd3b412cde79520f1c5b22eb2f7dfaa8215 Mon Sep 17 00:00:00 2001 From: Francisco Krause Arnim Date: Mon, 13 Nov 2023 16:23:25 -0300 Subject: [PATCH 15/16] Add rust cache --- .github/workflows/ci.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index fe49ee88..09096a7b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -71,6 +71,9 @@ jobs: - name: Setup rust nightly uses: dtolnay/rust-toolchain@nightly + - name: Setup rust cache + uses: Swatinem/rust-cache@v2 + - name: Setup project run: make setup - name: Build test node From a107195c5a05c7892a108940e8bcf3aee7cf4930 Mon Sep 17 00:00:00 2001 From: Francisco Krause Arnim Date: Mon, 13 Nov 2023 17:07:59 -0300 Subject: [PATCH 16/16] Update test-node step --- .github/workflows/ci.yaml | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 09096a7b..e132c036 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -76,18 +76,8 @@ jobs: - name: Setup project run: make setup - - name: Build test node - run: make build-test-node - - # - name: Wait for era test node to build - # run: | - # PORT=8011 - # nc -l -p $PORT & - # NC_PID=$! - # timeout 600 tail -f /dev/null - # kill $NC_PID - # echo "Timeout: Test node did not start ..." - + - name: Build and run test node + run: make build-test-node run - name: Run tests working-directory: tests