diff --git a/.github/workflows/build-push-docker.yml b/.github/workflows/build-push-docker.yml index 42c42d45..3208c9ee 100644 --- a/.github/workflows/build-push-docker.yml +++ b/.github/workflows/build-push-docker.yml @@ -106,3 +106,45 @@ jobs: run: | echo "Image tags: ghcr.io/${{ github.repository_owner }}/anvil-zksync:${{ env.BASE_TAG }}-${{ matrix.arch }}" >> $GITHUB_STEP_SUMMARY echo "Image tags: us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/anvil-zksync:${{ env.BASE_TAG }}-${{ matrix.arch }}" >> $GITHUB_STEP_SUMMARY + + create-latest-tag: + name: Create and Push Docker Manifest with "latest" Tag + runs-on: [matterlabs-ci-runner] + needs: + - build-push-image + - set-tags + if: needs.set-tags.outputs.base_tag != 'none' + steps: + - name: Login to GAR + run: | + gcloud auth configure-docker us-docker.pkg.dev -q + + - name: Login to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set Repository Owner + run: echo "REPO_OWNER=${{ github.repository_owner }}" >> $GITHUB_ENV + + - name: Set Up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Create and Push Docker Manifest + run: | + # Create a multi-platform manifest with the "latest" tag + docker buildx imagetools create \ + ghcr.io/${{ env.REPO_OWNER }}/anvil-zksync:${{ needs.set-tags.outputs.base_tag }}-amd64 \ + ghcr.io/${{ env.REPO_OWNER }}/anvil-zksync:${{ needs.set-tags.outputs.base_tag }}-arm64 \ + --tag ghcr.io/${{ env.REPO_OWNER }}/anvil-zksync:latest + + docker buildx imagetools create \ + us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/anvil-zksync:${{ needs.set-tags.outputs.base_tag }}-amd64 \ + us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/anvil-zksync:${{ needs.set-tags.outputs.base_tag }}-arm64 \ + --tag us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/anvil-zksync:latest + + - name: Print Manifest Tags to Summary + run: | + echo "Manifest tags: latest" >> $GITHUB_STEP_SUMMARY \ No newline at end of file diff --git a/e2e-tests/test/anvil-apis.test.ts b/e2e-tests/test/anvil-apis.test.ts index 58ddcca5..26dd52fb 100644 --- a/e2e-tests/test/anvil-apis.test.ts +++ b/e2e-tests/test/anvil-apis.test.ts @@ -93,9 +93,6 @@ describe("anvil_setLoggingEnabled", function () { it("Should disable and enable logging", async function () { const logFilePath = process.env.ANVIL_LOG_PATH || path.resolve("../anvil-zksync.log"); - console.log(`ANVIL_LOG_PATH: ${process.env.ANVIL_LOG_PATH}`); - console.log(`Using logFilePath: ${logFilePath}`); - // Arrange const wallet = new Wallet(RichAccounts[0].PrivateKey, provider); const userWallet = Wallet.createRandom().connect(provider); @@ -103,13 +100,20 @@ describe("anvil_setLoggingEnabled", function () { // Act await provider.send("anvil_setLoggingEnabled", [false]); - const logSizeBefore = fs.statSync(logFilePath).size; + let logSizeBefore = 0; + if (fs.existsSync(logFilePath)) { + logSizeBefore = fs.statSync(logFilePath).size; + } await wallet.sendTransaction({ to: userWallet.address, value: ethers.parseEther("0.1"), }); - const logSizeAfter = fs.statSync(logFilePath).size; + + let logSizeAfter = 0; + if (fs.existsSync(logFilePath)) { + logSizeAfter = fs.statSync(logFilePath).size; + } // Reset await provider.send("anvil_setLoggingEnabled", [true]);