From 92276fa383786de09fff53bdb1c0929178a6be4c Mon Sep 17 00:00:00 2001 From: sudo rm -rf --no-preserve-root / Date: Thu, 23 Nov 2023 17:19:05 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=E2=80=8D=E2=99=82=EF=B8=8F=20Use?= =?UTF-8?q?=20`pull=5Frequest=5Ftarget`=20in=20Tests=20(#88)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pascal Marco Caversaccio --- .github/workflows/checks.yml | 2 +- .github/workflows/test-contracts.yml | 10 +++--- package.json | 4 +-- pnpm-lock.yaml | 53 +++++++++++++++++++++------- 4 files changed, 49 insertions(+), 20 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 6859054..b0e9582 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -1,6 +1,6 @@ name: 👮‍♂️ Sanity checks -on: [push, pull_request] +on: [push, pull_request, workflow_dispatch] concurrency: group: ${{github.workflow}}-${{github.ref}} diff --git a/.github/workflows/test-contracts.yml b/.github/workflows/test-contracts.yml index 72c5d7e..53400b4 100644 --- a/.github/workflows/test-contracts.yml +++ b/.github/workflows/test-contracts.yml @@ -1,6 +1,6 @@ name: 🕵️‍♂️ Test smart contracts -on: [push, pull_request] +on: [push, pull_request, pull_request_target, workflow_dispatch] concurrency: group: ${{github.workflow}}-${{github.ref}} @@ -143,16 +143,16 @@ jobs: FOUNDRY_PROFILE: default - name: Setup LCOV - if: github.event_name == 'pull_request' + if: ${{ (github.event.pull_request.head.repo.full_name == github.repository && github.event_name == 'pull_request') || (github.event.pull_request.head.repo.full_name != github.repository && github.event_name == 'pull_request_target') }} uses: hrishikesh-kadam/setup-lcov@v1 # See https://github.com/ScopeLift/foundry-template/blob/fd3875d2e99a65dec19431723d6516b4ed76746e/.github/workflows/ci.yml#L49-L78. - name: Remove unnecessary `test` directory - if: github.event_name == 'pull_request' + if: ${{ (github.event.pull_request.head.repo.full_name == github.repository && github.event_name == 'pull_request') || (github.event.pull_request.head.repo.full_name != github.repository && github.event_name == 'pull_request_target') }} run: lcov --remove lcov.info 'test/*' 'script/*' 'node_modules/*' --output-file lcov.info --rc lcov_branch_coverage=1 - name: Post coverage report - if: github.event_name == 'pull_request' + if: ${{ (github.event.pull_request.head.repo.full_name == github.repository && github.event_name == 'pull_request') || (github.event.pull_request.head.repo.full_name != github.repository && github.event_name == 'pull_request_target') }} uses: romeovs/lcov-reporter-action@v0.3.1 with: delete-old-comments: true @@ -160,7 +160,7 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} - name: Verify minimum coverage - if: github.event_name == 'pull_request' + if: ${{ (github.event.pull_request.head.repo.full_name == github.repository && github.event_name == 'pull_request') || (github.event.pull_request.head.repo.full_name != github.repository && github.event_name == 'pull_request_target') }} uses: zgosalvez/github-actions-report-lcov@v2 with: coverage-files: ./lcov.info diff --git a/package.json b/package.json index af0de58..c49522f 100644 --- a/package.json +++ b/package.json @@ -120,7 +120,7 @@ }, "devDependencies": { "@matterlabs/hardhat-zksync-deploy": "^1.0.0", - "@matterlabs/hardhat-zksync-solc": "^1.0.1", + "@matterlabs/hardhat-zksync-solc": "^1.0.2", "@matterlabs/hardhat-zksync-verify": "^1.1.0", "@matterlabs/hardhat-zksync-zksync2js": "0.0.1-beta.2", "@nomicfoundation/hardhat-chai-matchers": "^2.0.2", @@ -155,7 +155,7 @@ "ts-node": "^10.9.1", "typechain": "^8.3.2", "typescript": "^5.3.2", - "xdeployer": "^2.1.13", + "xdeployer": "^2.2.0", "zksync2-js": "^0.2.2" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index dc6c416..fb26113 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ devDependencies: specifier: ^1.0.0 version: 1.0.0(ethers@6.8.1)(hardhat@2.19.1)(zksync2-js@0.2.2) "@matterlabs/hardhat-zksync-solc": - specifier: ^1.0.1 - version: 1.0.1(hardhat@2.19.1) + specifier: ^1.0.2 + version: 1.0.2(hardhat@2.19.1) "@matterlabs/hardhat-zksync-verify": specifier: ^1.1.0 version: 1.1.0(@nomicfoundation/hardhat-verify@2.0.1)(hardhat@2.19.1) @@ -114,8 +114,8 @@ devDependencies: specifier: ^5.3.2 version: 5.3.2 xdeployer: - specifier: ^2.1.13 - version: 2.1.13(@nomicfoundation/hardhat-ethers@3.0.5)(ethers@6.8.1)(hardhat@2.19.1) + specifier: ^2.2.0 + version: 2.2.0(@nomicfoundation/hardhat-ethers@3.0.5)(ethers@6.8.1)(hardhat@2.19.1) zksync2-js: specifier: ^0.2.2 version: 0.2.2(ethers@6.8.1) @@ -983,17 +983,17 @@ packages: - supports-color dev: true - /@matterlabs/hardhat-zksync-solc@1.0.1(hardhat@2.19.1): + /@matterlabs/hardhat-zksync-solc@1.0.2(hardhat@2.19.1): resolution: { - integrity: sha512-WMqg42+f/1RVFVYHwV+Y9f5cO5lIrH7pDEXtA4WtHKHpvid3Wwo/ipYwS1DbF9vhDS7PaqgknuuyouDnilyUvQ==, + integrity: sha512-y21JuRfcJcdTdC+1IovfanysaOxyJBROc8QT7tqLWgtu2OLOCXgpd67ZKVVJkO0L9Vu2B0xDUv83KOgZvn6ZWg==, } peerDependencies: hardhat: ^2.18.1 dependencies: "@nomiclabs/hardhat-docker": 2.0.2 chalk: 4.1.2 - dockerode: 3.3.5 + dockerode: 4.0.0 fs-extra: 11.1.1 hardhat: 2.19.1(ts-node@10.9.1)(typescript@5.3.2) proper-lockfile: 4.1.2 @@ -1011,7 +1011,7 @@ packages: peerDependencies: "@nomicfoundation/hardhat-verify": ^2.0.0 dependencies: - "@matterlabs/hardhat-zksync-solc": 1.0.1(hardhat@2.19.1) + "@matterlabs/hardhat-zksync-solc": 1.0.2(hardhat@2.19.1) "@nomicfoundation/hardhat-verify": 2.0.1(hardhat@2.19.1) axios: 1.6.2(debug@4.3.4) chalk: 4.1.2 @@ -4494,6 +4494,21 @@ packages: - supports-color dev: true + /docker-modem@5.0.1: + resolution: + { + integrity: sha512-vqrE/nrweCyzmCpVpdFRC41qS+tfTF+IoUKlTZr52O82urbUqdfyJBGWMvT01pYUprWepLr8IkyVTEWJKRTQSg==, + } + engines: { node: ">= 8.0" } + dependencies: + debug: 4.3.4(supports-color@8.1.1) + readable-stream: 3.6.2 + split-ca: 1.0.1 + ssh2: 1.14.0 + transitivePeerDependencies: + - supports-color + dev: true + /dockerode@2.5.8: resolution: { @@ -4522,6 +4537,20 @@ packages: - supports-color dev: true + /dockerode@4.0.0: + resolution: + { + integrity: sha512-3LF7/3MPz5+9RsUo91rD0MCcx0yxjC9bnbtgtVjOLKyKxlZSJ7/Kk3OPAgARlwlWHqXwAGYhmkAHYx7IwD0tJQ==, + } + engines: { node: ">= 8.0" } + dependencies: + "@balena/dockerignore": 1.0.2 + docker-modem: 5.0.1 + tar-fs: 2.0.1 + transitivePeerDependencies: + - supports-color + dev: true + /doctrine@3.0.0: resolution: { @@ -11043,16 +11072,16 @@ packages: optional: true dev: true - /xdeployer@2.1.13(@nomicfoundation/hardhat-ethers@3.0.5)(ethers@6.8.1)(hardhat@2.19.1): + /xdeployer@2.2.0(@nomicfoundation/hardhat-ethers@3.0.5)(ethers@6.8.1)(hardhat@2.19.1): resolution: { - integrity: sha512-QxVsQ+zz+cnhzCIs7/e5F06nKjOD2Lb47nW52Jw3IzFQVeYv6NfvokhZiez+y8jkzwvHDwVru+fCVlml0GQGkw==, + integrity: sha512-ujy8+cYFlAb7owK9mq29pUFWOywGdzNXJJmKwiYbMajvPWKTrUEGk+Zkv/sNWE3ACrfVxU2Sus9LoA6VxKnWFg==, } engines: { node: ">=14.0.0" } peerDependencies: - "@nomicfoundation/hardhat-ethers": ^3.0.4 + "@nomicfoundation/hardhat-ethers": ^3.0.5 ethers: ^6.8.1 - hardhat: ^2.19.0 + hardhat: ^2.19.1 dependencies: "@nomicfoundation/hardhat-ethers": 3.0.5(ethers@6.8.1)(hardhat@2.19.1) ethers: 6.8.1