Skip to content

Commit

Permalink
Test (#73)
Browse files Browse the repository at this point in the history
* Test

* Fixup

* Test failure

* f
  • Loading branch information
samuelburnham authored Mar 12, 2024
1 parent 58a9f6e commit cb3d9a6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/solidity.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Test
# TODO: Reusify and combine with the `check-lurk-compiles` action and/or make a reusable open-issue action
# This workflow runs compatibility tests on a PR
# On a `pull_request` failure, it writes a PR comment to ensure the author/reviewer are notified
Expand Down Expand Up @@ -38,10 +39,11 @@ jobs:
id: commit
if: steps.solidity-test.outcome != 'success'
run: |
if [[ -s ${{ github.event.pull_request }} ]]; then
SHA=${{ github.event.pull_request.head_sha }}
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
SHA=${{ github.event.pull_request.head.sha }}
else
SHA=${{ github.event.merge_group.head_sha }}
fi
echo "sha=$SHA" | tee -a $GITHUB_OUTPUT
# Gets the PR info regardless of whether the workflow is triggered by `pull_request` or `merge_group`
- uses: 8BitJonny/[email protected]
Expand All @@ -56,13 +58,13 @@ jobs:
WORKFLOW_URL=https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
echo "WORKFLOW_URL=$WORKFLOW_URL" | tee -a $GITHUB_ENV
echo "WORKFLOW_FILE=$WORKFLOW_URL/workflow" | tee -a $GITHUB_ENV
echo "COMMIT=${{ steps.pr.outputs.}}" | tee -a $GITHUB_ENV
echo "COMMIT=${{ steps.commit.outputs.sha }}" | tee -a $GITHUB_ENV
echo "PR_URL=${{ steps.pr.outputs.prUrl }}" | tee -a $GITHUB_ENV
- name: Comment on failing run
if: steps.solidity-test.outcome != 'success'
if: steps.solidity-test.outcome != 'success' && github.event_name == 'pull_request'
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.issue.number }}
issue-number: ${{ github.event.pull_request.number }}
body: |
`solidity-verifier` compatibility test failed :x:
Expand All @@ -72,7 +74,7 @@ jobs:
#with:
#repository: lurk-lab/solidity-verifier
- uses: JasonEtco/create-an-issue@v2
if: steps.solidity-test.outcome != 'success' && (github.event_name != 'pull_request' || github.event.action == 'enqueued')
if: steps.solidity-test.outcome != 'success' && (github.event_name != 'pull_request' || github.event.action == 'enqueued')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WORKFLOW_URL: ${{ env.WORKFLOW_URL }}
Expand All @@ -82,3 +84,6 @@ jobs:
with:
update_existing: true
filename: .github/templates/SOLIDITY_COMPAT_ISSUE.md
# Prevent merge of required check (test)
- if: steps.solidity-test.outcome != 'success' && (github.event_name != 'pull_request' || github.event.action == 'enqueued')
run: exit 1
2 changes: 1 addition & 1 deletion src/test.rs → src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ mod test {
#[ignore]
#[test]
fn test_solidity_compatibility_ipa() {
assert!(true)
panic!()
}
}

0 comments on commit cb3d9a6

Please sign in to comment.