Skip to content

Commit

Permalink
test manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
dutterbutter committed Dec 19, 2024
1 parent b2a0b54 commit 6ceb9f9
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 5 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/build-push-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 9 additions & 5 deletions e2e-tests/test/anvil-apis.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,23 +93,27 @@ 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);

// 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]);
Expand Down

0 comments on commit 6ceb9f9

Please sign in to comment.