Skip to content

Commit

Permalink
👷‍♂️ Use pull_request_target in Tests (#88)
Browse files Browse the repository at this point in the history
Signed-off-by: Pascal Marco Caversaccio <[email protected]>
  • Loading branch information
pcaversaccio authored Nov 23, 2023
1 parent dd7a51b commit 92276fa
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 👮‍♂️ Sanity checks

on: [push, pull_request]
on: [push, pull_request, workflow_dispatch]

concurrency:
group: ${{github.workflow}}-${{github.ref}}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test-contracts.yml
Original file line number Diff line number Diff line change
@@ -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}}
Expand Down Expand Up @@ -143,24 +143,24 @@ 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/[email protected]
with:
delete-old-comments: true
lcov-file: ./lcov.info
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
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"
}
}
53 changes: 41 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 92276fa

Please sign in to comment.