-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
100 additions
and
98 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,25 +96,3 @@ jobs: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
working-directory: . | ||
update-comment: true | ||
slither: | ||
name: Slither | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Setup reviewdog | ||
uses: reviewdog/action-setup@v1 | ||
with: | ||
reviewdog_version: latest | ||
- name: Run Slither | ||
uses: crytic/[email protected] | ||
id: slither | ||
with: | ||
node-version: 20 | ||
sarif: 'results.sarif' | ||
fail-on: none | ||
slither-args: --filter-paths node_modules/ | ||
- name: Upload SARIF file | ||
uses: github/codeql-action/upload-sarif@v3 | ||
with: | ||
sarif_file: ${{ steps.slither.outputs.sarif }} |
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,79 +1,103 @@ | ||
name: CI | ||
on: | ||
push: | ||
workflow_dispatch: | ||
on: | ||
push: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20.x' | ||
cache: 'npm' | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Build contracts | ||
id: build | ||
run: npm run compile | ||
- name: "Add build summary" | ||
if: ${{ success() || failure() }} | ||
run: | | ||
echo "## Build result" >> $GITHUB_STEP_SUMMARY | ||
- name: "Add build result (success)" | ||
if: ${{ success() && steps.build.outcome == 'success' }} | ||
run: | | ||
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY | ||
- name: "Add build result (failed)" | ||
if: ${{ failure() && steps.build.outcome == 'failure' }} | ||
run: | | ||
echo "❌ Failed" >> $GITHUB_STEP_SUMMARY | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20.x' | ||
cache: 'npm' | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Test contracts | ||
id: run_tests | ||
run: | | ||
(npm run --silent test >> /tmp/TEST_OUTPUT) || FAILED=1 | ||
{ | ||
echo "test_output<<RANDOM_DELIMITER_THAT_MOST_DEFINITELY_WONT_APPEAR_IN_TEXT" | ||
cat /tmp/TEST_OUTPUT | ||
echo "RANDOM_DELIMITER_THAT_MOST_DEFINITELY_WONT_APPEAR_IN_TEXT" | ||
} >> "$GITHUB_OUTPUT" | ||
cat /tmp/TEST_OUTPUT | ||
if [ ${FAILED:-0} -eq 1 ] | ||
then | ||
exit 1 | ||
fi | ||
- name: "Add test summary" | ||
if: ${{ success() || failure() }} | ||
run: | | ||
echo "## Tests result" >> $GITHUB_STEP_SUMMARY | ||
echo "" >> $GITHUB_STEP_SUMMARY | ||
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY | ||
echo "${{steps.run_tests.outputs.test_output}}" >> $GITHUB_STEP_SUMMARY | ||
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY | ||
echo "" >> $GITHUB_STEP_SUMMARY | ||
- name: "Add test result (success)" | ||
if: ${{ success() && steps.run_tests.outcome == 'success' }} | ||
run: | | ||
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY | ||
- name: "Add test result (failed)" | ||
if: ${{ failure() && steps.run_tests.outcome == 'failure' }} | ||
run: | | ||
echo "❌ Failed" >> $GITHUB_STEP_SUMMARY | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20.x' | ||
cache: 'npm' | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Build contracts | ||
id: build | ||
run: npm run compile | ||
- name: 'Add build summary' | ||
if: ${{ success() || failure() }} | ||
run: | | ||
echo "## Build result" >> $GITHUB_STEP_SUMMARY | ||
- name: 'Add build result (success)' | ||
if: ${{ success() && steps.build.outcome == 'success' }} | ||
run: | | ||
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY | ||
- name: 'Add build result (failed)' | ||
if: ${{ failure() && steps.build.outcome == 'failure' }} | ||
run: | | ||
echo "❌ Failed" >> $GITHUB_STEP_SUMMARY | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20.x' | ||
cache: 'npm' | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Test contracts | ||
id: run_tests | ||
run: | | ||
(npm run --silent test >> /tmp/TEST_OUTPUT) || FAILED=1 | ||
{ | ||
echo "test_output<<RANDOM_DELIMITER_THAT_MOST_DEFINITELY_WONT_APPEAR_IN_TEXT" | ||
cat /tmp/TEST_OUTPUT | ||
echo "RANDOM_DELIMITER_THAT_MOST_DEFINITELY_WONT_APPEAR_IN_TEXT" | ||
} >> "$GITHUB_OUTPUT" | ||
cat /tmp/TEST_OUTPUT | ||
if [ ${FAILED:-0} -eq 1 ] | ||
then | ||
exit 1 | ||
fi | ||
- name: 'Add test summary' | ||
if: ${{ success() || failure() }} | ||
run: | | ||
echo "## Tests result" >> $GITHUB_STEP_SUMMARY | ||
echo "" >> $GITHUB_STEP_SUMMARY | ||
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY | ||
echo "${{steps.run_tests.outputs.test_output}}" >> $GITHUB_STEP_SUMMARY | ||
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY | ||
echo "" >> $GITHUB_STEP_SUMMARY | ||
- name: 'Add test result (success)' | ||
if: ${{ success() && steps.run_tests.outcome == 'success' }} | ||
run: | | ||
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY | ||
- name: 'Add test result (failed)' | ||
if: ${{ failure() && steps.run_tests.outcome == 'failure' }} | ||
run: | | ||
echo "❌ Failed" >> $GITHUB_STEP_SUMMARY | ||
slither: | ||
name: Slither | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Setup reviewdog | ||
uses: reviewdog/action-setup@v1 | ||
with: | ||
reviewdog_version: latest | ||
- name: Run Slither | ||
uses: crytic/[email protected] | ||
id: slither | ||
with: | ||
node-version: 20 | ||
sarif: 'results.sarif' | ||
fail-on: none | ||
slither-args: --filter-paths node_modules/ | ||
- name: Upload SARIF file | ||
uses: github/codeql-action/upload-sarif@v3 | ||
with: | ||
sarif_file: ${{ steps.slither.outputs.sarif }} |