From fdd34e7cad65a47e3a97d219b95525c309776b4b Mon Sep 17 00:00:00 2001 From: Yury Akudovich Date: Fri, 13 Oct 2023 11:33:22 +0200 Subject: [PATCH 1/9] Improves workflows. Replaces outdated ::set-output. Removes unneeded secret. Marks ssh public key as sensitive. Fixes comments. --- .github/workflows/docker_build.yaml | 7 ++++--- .github/workflows/load_testing.yaml | 1 - docker/localenv.Dockerfile | 6 +++--- infrastructure/loadtests/outputs.tf | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/docker_build.yaml b/.github/workflows/docker_build.yaml index edcdd470..d2d1d536 100644 --- a/.github/workflows/docker_build.yaml +++ b/.github/workflows/docker_build.yaml @@ -17,7 +17,8 @@ jobs: - name: Set outputs id: vars - run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" + run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + - name: Login to GAR run: | gcloud auth configure-docker us-docker.pkg.dev -q @@ -29,11 +30,11 @@ jobs: id: set_version run: | if [[ ${{ github.ref }} =~ "refs/tags" ]]; then - echo "::set-output name=image_tag_suffix::${GITHUB_REF#refs/*/}" + echo "image_tag_suffix=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT else sha=$(git rev-parse --short HEAD) ts=$(date +%s%N | cut -b1-13) - echo "::set-output name=image_tag_suffix::${sha}-${ts}" + echo "image_tag_suffix=${sha}-${ts}" >> $GITHUB_OUTPUT fi - name: Log in to Docker Hub uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0 diff --git a/.github/workflows/load_testing.yaml b/.github/workflows/load_testing.yaml index 9d33dadc..4530184e 100644 --- a/.github/workflows/load_testing.yaml +++ b/.github/workflows/load_testing.yaml @@ -51,7 +51,6 @@ jobs: - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3 with: node-version: 16 - token: ${{ secrets.GITHUB_TOKEN }} - name: Setup Terraform uses: hashicorp/setup-terraform@v2 diff --git a/docker/localenv.Dockerfile b/docker/localenv.Dockerfile index b1c81e33..029be8bd 100644 --- a/docker/localenv.Dockerfile +++ b/docker/localenv.Dockerfile @@ -24,7 +24,7 @@ RUN cargo run -p tools --bin localnet_config -- --nodes=$nodes WORKDIR /usr/src/myapp/node RUN cargo build -p executor --release -# Create the artifacts directory +# Create the artifacts directory WORKDIR /usr/src/myapp/node/ RUN i=0; \ while [ $i -lt $nodes ]; do \ @@ -57,5 +57,5 @@ RUN i=0; \ i=$(expr $i + 1); \ done -# Some rundom command -CMD ["echo", "Done"] \ No newline at end of file +# Report succes +CMD ["echo", "Done"] diff --git a/infrastructure/loadtests/outputs.tf b/infrastructure/loadtests/outputs.tf index 3674e9b7..a8d6d350 100644 --- a/infrastructure/loadtests/outputs.tf +++ b/infrastructure/loadtests/outputs.tf @@ -1,9 +1,9 @@ - output "instance_public_ips" { description = "Public IPs of the instances" value = [for instance in google_compute_instance.zksync_bft_node : instance.network_interface[0].access_config[0].nat_ip] } output "ssh_key" { - value = tls_private_key.ssh.public_key_openssh + value = tls_private_key.ssh.public_key_openssh + sensitive = true } From 9968449651959fd956709b28fbbf334298da2226 Mon Sep 17 00:00:00 2001 From: Yury Akudovich Date: Fri, 13 Oct 2023 11:38:10 +0200 Subject: [PATCH 2/9] Revert "disabled coverage CI test (#5)" This reverts commit 1d943aeebe74bf80a87232db1d62fc4464268014. --- .github/workflows/coverage.yaml | 43 +++++++++++++++++++++++++++++++++ codecov.yml | 17 +++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 .github/workflows/coverage.yaml create mode 100644 codecov.yml diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml new file mode 100644 index 00000000..76265567 --- /dev/null +++ b/.github/workflows/coverage.yaml @@ -0,0 +1,43 @@ +name: coverage + +on: + pull_request: + branches: [ "*" ] + +jobs: + check: + name: Rust project + runs-on: ubuntu-latest + + defaults: + run: + working-directory: ./node + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Install stable toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + + - name: Run cargo-tarpaulin + uses: actions-rs/tarpaulin@v0.1 + with: + version: '0.15.0' + args: '--manifest-path node/Cargo.toml -- --test-threads 1' + env: + RUST_LOG: 'network=trace,sync_blocks=trace,consensus=trace' + + - name: Upload to codecov.io + uses: codecov/codecov-action@v1.0.2 + with: + token: ${{secrets.CODECOV_TOKEN}} + + - name: Archive code coverage results + uses: actions/upload-artifact@v1 + with: + name: code-coverage-report + path: cobertura.xml diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 00000000..7fe44e38 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,17 @@ +coverage: + range: "10...90" + status: + # We might gate PRs based on coverage diffs, + # but we don't want that for now + project: + default: + informational: true + patch: + default: + informational: true + +comment: + require_changes: true + +github_checks: + annotations: false \ No newline at end of file From 5c8fc79ffe902715e0335fc8603d7e22a9717d02 Mon Sep 17 00:00:00 2001 From: Yury Akudovich Date: Fri, 13 Oct 2023 11:39:18 +0200 Subject: [PATCH 3/9] Uses ubuntu-22.04-github-hosted-16core runner for coverage. --- .github/workflows/coverage.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 76265567..8af8ed3a 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -7,7 +7,7 @@ on: jobs: check: name: Rust project - runs-on: ubuntu-latest + runs-on: [ubuntu-22.04-github-hosted-16core] defaults: run: From 65ef4174bbaf5ac6ba0e42f948aea5071b66ebd9 Mon Sep 17 00:00:00 2001 From: Yury Akudovich Date: Fri, 13 Oct 2023 11:41:17 +0200 Subject: [PATCH 4/9] Uses ubuntu-22.04-github-hosted-16core runner for protobuf_conformance and rust workflows. --- .github/workflows/protobuf_conformance.yaml | 2 +- .github/workflows/rust.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/protobuf_conformance.yaml b/.github/workflows/protobuf_conformance.yaml index 6545a131..d6a29b5d 100644 --- a/.github/workflows/protobuf_conformance.yaml +++ b/.github/workflows/protobuf_conformance.yaml @@ -16,7 +16,7 @@ env: jobs: conformance: - runs-on: ubuntu-latest + runs-on: [ubuntu-22.04-github-hosted-16core] steps: - uses: actions/checkout@v3 with: diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 215a84c0..30b552c1 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -20,7 +20,7 @@ env: jobs: check-build-test: - runs-on: ubuntu-latest + runs-on: [ubuntu-22.04-github-hosted-16core] defaults: run: From 2c6a1502946bff98920fcce100a80185062ce0d5 Mon Sep 17 00:00:00 2001 From: Yury Akudovich Date: Fri, 13 Oct 2023 12:04:31 +0200 Subject: [PATCH 5/9] Use 16 threads for coverage. --- .github/workflows/coverage.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 8af8ed3a..3078fa50 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -27,7 +27,7 @@ jobs: uses: actions-rs/tarpaulin@v0.1 with: version: '0.15.0' - args: '--manifest-path node/Cargo.toml -- --test-threads 1' + args: '--manifest-path node/Cargo.toml -- --test-threads 16' env: RUST_LOG: 'network=trace,sync_blocks=trace,consensus=trace' From 13661cdad7787a6d85ffb35f3cc38fd2b1af3c21 Mon Sep 17 00:00:00 2001 From: Yury Akudovich Date: Fri, 13 Oct 2023 12:19:57 +0200 Subject: [PATCH 6/9] Switches to tarpaulin 0.27.1. Sets timeout to 5min. --- .github/workflows/coverage.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 3078fa50..d2b05684 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -26,15 +26,15 @@ jobs: - name: Run cargo-tarpaulin uses: actions-rs/tarpaulin@v0.1 with: - version: '0.15.0' - args: '--manifest-path node/Cargo.toml -- --test-threads 16' + version: '0.27.1' + args: '--manifest-path node/Cargo.toml -- --test-threads 16 --timeout 300' env: RUST_LOG: 'network=trace,sync_blocks=trace,consensus=trace' - name: Upload to codecov.io uses: codecov/codecov-action@v1.0.2 with: - token: ${{secrets.CODECOV_TOKEN}} + token: ${{ secrets.CODECOV_TOKEN }} - name: Archive code coverage results uses: actions/upload-artifact@v1 From 7484635be8a8cd718b57ed4f24fafa45e58706a0 Mon Sep 17 00:00:00 2001 From: Yury Akudovich Date: Fri, 13 Oct 2023 12:25:00 +0200 Subject: [PATCH 7/9] Uses tarpaulin 0.27.0. --- .github/workflows/coverage.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index d2b05684..d42d12ae 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -26,7 +26,7 @@ jobs: - name: Run cargo-tarpaulin uses: actions-rs/tarpaulin@v0.1 with: - version: '0.27.1' + version: '0.27.0' args: '--manifest-path node/Cargo.toml -- --test-threads 16 --timeout 300' env: RUST_LOG: 'network=trace,sync_blocks=trace,consensus=trace' From c377e8dc70e742c3e0ab5ad10bfddfd8faf585c0 Mon Sep 17 00:00:00 2001 From: Yury Akudovich Date: Fri, 13 Oct 2023 12:27:35 +0200 Subject: [PATCH 8/9] Switches tarpaulin back to 0.15.0. --- .github/workflows/coverage.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index d42d12ae..a7f3bb0e 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -26,7 +26,7 @@ jobs: - name: Run cargo-tarpaulin uses: actions-rs/tarpaulin@v0.1 with: - version: '0.27.0' + version: '0.15.0' args: '--manifest-path node/Cargo.toml -- --test-threads 16 --timeout 300' env: RUST_LOG: 'network=trace,sync_blocks=trace,consensus=trace' From bfe45bb4aece2af3c3396f6c18121e69391473cc Mon Sep 17 00:00:00 2001 From: Yury Akudovich Date: Fri, 13 Oct 2023 12:45:24 +0200 Subject: [PATCH 9/9] Removes coverage because it doesn't work. --- .github/workflows/coverage.yaml | 43 --------------------------------- codecov.yml | 17 ------------- 2 files changed, 60 deletions(-) delete mode 100644 .github/workflows/coverage.yaml delete mode 100644 codecov.yml diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml deleted file mode 100644 index a7f3bb0e..00000000 --- a/.github/workflows/coverage.yaml +++ /dev/null @@ -1,43 +0,0 @@ -name: coverage - -on: - pull_request: - branches: [ "*" ] - -jobs: - check: - name: Rust project - runs-on: [ubuntu-22.04-github-hosted-16core] - - defaults: - run: - working-directory: ./node - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Install stable toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - - name: Run cargo-tarpaulin - uses: actions-rs/tarpaulin@v0.1 - with: - version: '0.15.0' - args: '--manifest-path node/Cargo.toml -- --test-threads 16 --timeout 300' - env: - RUST_LOG: 'network=trace,sync_blocks=trace,consensus=trace' - - - name: Upload to codecov.io - uses: codecov/codecov-action@v1.0.2 - with: - token: ${{ secrets.CODECOV_TOKEN }} - - - name: Archive code coverage results - uses: actions/upload-artifact@v1 - with: - name: code-coverage-report - path: cobertura.xml diff --git a/codecov.yml b/codecov.yml deleted file mode 100644 index 7fe44e38..00000000 --- a/codecov.yml +++ /dev/null @@ -1,17 +0,0 @@ -coverage: - range: "10...90" - status: - # We might gate PRs based on coverage diffs, - # but we don't want that for now - project: - default: - informational: true - patch: - default: - informational: true - -comment: - require_changes: true - -github_checks: - annotations: false \ No newline at end of file