-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into implement-glacis-LF-11761
- Loading branch information
Showing
76 changed files
with
4,821 additions
and
3,520 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
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 |
---|---|---|
|
@@ -29,22 +29,40 @@ jobs: | |
MIN_TEST_COVERAGE: ${{ secrets.MIN_TEST_COVERAGE }} | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Check for Solidity file changes | ||
id: check_files | ||
run: | | ||
git fetch origin ${{ github.base_ref }} --depth=1 | ||
CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }}...HEAD | grep -E '^src/.*\.sol|^test/.*\.sol' || true) | ||
if [[ -n "$CHANGED_FILES" ]]; then | ||
echo "solidity_changed=true" >> "$GITHUB_ENV" | ||
else | ||
echo "solidity_changed=false" >> "$GITHUB_ENV" | ||
fi | ||
- name: Set up Node.js | ||
uses: actions/[email protected] | ||
with: | ||
node-version: '20' | ||
if: env.solidity_changed == 'true' | ||
|
||
- name: Install dev dependencies | ||
run: yarn install | ||
if: env.solidity_changed == 'true' | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/[email protected] | ||
if: env.solidity_changed == 'true' | ||
|
||
- name: Install Dependencies | ||
run: forge install | ||
if: env.solidity_changed == 'true' | ||
|
||
- name: Generate Coverage Report | ||
if: env.solidity_changed == 'true' | ||
run: | | ||
forge coverage --report lcov --force --evm-version 'shanghai' --ir-minimum | ||
|
@@ -55,6 +73,7 @@ jobs: | |
echo "Coverage report successfully filtered" | ||
- name: Generate Coverage Summary | ||
if: env.solidity_changed == 'true' | ||
run: | | ||
|
@@ -133,6 +152,7 @@ jobs: | |
} >> "$GITHUB_ENV" | ||
- name: Comment with Coverage Summary in PR | ||
if: env.solidity_changed == 'true' | ||
uses: mshick/[email protected] | ||
with: | ||
repo-token: ${{ secrets.GIT_ACTIONS_BOT_PAT_CLASSIC }} | ||
|
@@ -142,3 +162,8 @@ jobs: | |
${{ env.FUNCTION_COVERAGE_REPORT }} | ||
${{ env.BRANCH_COVERAGE_REPORT }} | ||
${{ env.RESULT_COVERAGE_REPORT }} | ||
- name: Skip Tests (No Solidity Changes) | ||
if: env.solidity_changed == 'false' | ||
run: echo "No Solidity files changed. Skipping test coverage check." |
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Olympix Static Analysis | ||
|
||
# - runs the olympix static analyzer on newly added or modified solidity contracts inside the src/ folder in a pull request | ||
# - detects potential security vulnerabilities and uploads the results to github code scanning | ||
# - only scans diff (added, renamed, modified) solidity files in src/ instead of the whole repository | ||
# - ensures security issues are identified before merging, allowing the team to review and discuss findings within the PR | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
- ready_for_review | ||
paths: | ||
- 'src/**/*.sol' | ||
|
||
jobs: | ||
static-analysis: | ||
name: Static Analysis Security Check | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get added, renamed, modified Solidity Files | ||
id: changed-files | ||
uses: tj-actions/changed-files@v45 | ||
with: | ||
files: | | ||
src/**/*.sol | ||
- name: Convert Changed Files to Args | ||
if: steps.changed-files.outputs.any_changed == 'true' | ||
id: format-args | ||
env: | ||
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} | ||
run: | | ||
args=$(echo $ALL_CHANGED_FILES | xargs -n 1 -I {} printf -- "-p %s " "{}") | ||
echo "ARGS=$args" >> $GITHUB_ENV | ||
- name: Run Olympix Integrated Security | ||
if: steps.changed-files.outputs.any_changed == 'true' | ||
uses: olympix/integrated-security@main | ||
env: | ||
OLYMPIX_API_TOKEN: ${{ secrets.OLYMPIX_API_TOKEN }} | ||
with: | ||
args: --output-format sarif --output-path ./ ${{ env.ARGS }} | ||
|
||
- name: Upload Result to GitHub Code Scanning | ||
if: steps.changed-files.outputs.any_changed == 'true' | ||
uses: github/codeql-action/upload-sarif@v3 | ||
with: | ||
sarif_file: olympix.sarif |
Oops, something went wrong.