-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
👷♂️ Use
pull_request_target
in Tests (#88)
Signed-off-by: Pascal Marco Caversaccio <[email protected]>
- Loading branch information
1 parent
dd7a51b
commit 92276fa
Showing
4 changed files
with
49 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}} | ||
|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.