forked from sonic-net/DASH
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* main: (75 commits) [dash-SAI] Enable warnings as errors (sonic-net#466) [SAI] wrong code generated in libsai sonic-net#415 (sonic-net#463) Fix incorrect IP in SONiC-DASH HLD VNET to VNET example. (sonic-net#459) DASH pipeline packet flow update proposal. (sonic-net#449) [libsai] Add attr name logging when doing get api (sonic-net#451) Build libsai deb packages in github workflow (sonic-net#450) Add Private Link mapping (sonic-net#327) [SAI] Update SAI submodule to the latest origin/master (sonic-net#446) [dash] Add libsai-debs target to create libsai debian packages (sonic-net#444) update p4 compile dependancy to avoid parallel docker runs (sonic-net#443) [dash] Refactor libsai (sonic-net#438) [dash] Update SAI to latest v1.13 (sonic-net#435) [dash-pipeline] Refactor Makefiles (sonic-net#432) Remove ACL tags from BM (sonic-net#425) [submodule] Update SAI submodule to origin/master (sonic-net#431) [sai-api-gen] Write files only when changes are detected (sonic-net#429) Adds SAI_ROUTE_ENTRY_ATTR_PACKET_ACTION api to dash_underlay_routing (sonic-net#422) [SAI] Add missing check for api initialized [SAI] Print oids in hex form [SAI] Change asserts to return error codes and add missing switch api ...
- Loading branch information
Showing
281 changed files
with
18,344 additions
and
4,062 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 |
---|---|---|
@@ -0,0 +1,93 @@ | ||
name: pre-commit-check | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- run: pip install pre-commit>=3.2.1 | ||
- run: pre-commit --version | ||
- run: git --version | ||
- run: git status | ||
- run: pre-commit install | ||
- run: git fetch origin | ||
- run: | | ||
set -x | ||
set +e | ||
OUTPUT=$(pre-commit run --color never --from-ref HEAD^ --to-ref HEAD 2>&1) | ||
EXIT_CODE=$? | ||
echo $OUTPUT | ||
echo $EXIT_CODE | ||
echo "pre_commit<<EOF" >> $GITHUB_ENV | ||
echo $OUTPUT >> $GITHUB_ENV | ||
echo "EOF" >> $GITHUB_ENV | ||
echo "exit_code=$EXIT_CODE" >> $GITHUB_ENV | ||
continue-on-error: true | ||
- name: Prepare comment | ||
if: ${{ env.exit_code != 0 }} | ||
env: | ||
PRE_COMMIT: ${{ env.pre_commit }} | ||
EXIT_CODE: ${{ env.exit_code }} | ||
run: | | ||
echo "$PRE_COMMIT" | ||
echo $EXIT_CODE | ||
if [[ `echo "$PRE_COMMIT" | wc -l` -gt 20 ]]; then | ||
PRE_COMMIT=`echo "$PRE_COMMIT" | head -n 20` | ||
PRE_COMMIT="$PRE_COMMIT\n...\n[truncated extra lines, please run pre-commit locally to view full check results]" | ||
PRE_COMMIT=`printf "$PRE_COMMIT"` | ||
fi | ||
br='<br/>' | ||
PR_MESSAGE="The [pre-commit](http://pre-commit.com/) check detected issues in the files touched by this pull request. | ||
Detailed pre-commit check results: | ||
<samp>$PRE_COMMIT</samp> | ||
To run the pre-commit checks locally, you can follow below steps: | ||
1. Ensure that default python is python3. | ||
2. Ensure that the \`pre-commit\` package is installed: | ||
\`\`\`sudo pip install pre-commit\`\`\` | ||
3. Go to repository root folder | ||
4. Install the pre-commit hooks: | ||
\`\`\`pre-commit install\`\`\` | ||
5. Use pre-commit to check staged file: | ||
\`\`\`pre-commit\`\`\` | ||
6. Alternatively, you can check committed files using: | ||
\`\`\`pre-commit run --from-ref <commit_id> --to-ref <commit_id>\`\`\` | ||
or | ||
\`\`\`pre-commit run --all-files\`\`\`" | ||
results=`echo "$PR_MESSAGE" | while read line; do echo $line$br; done | tr -d '\n'` | ||
echo "pre_commit_mod=$results" >> $GITHUB_ENV | ||
echo "exit_code=$EXIT_CODE" >> $GITHUB_ENV | ||
- name: Add comment to PR | ||
if: ${{ env.exit_code != 0 }} | ||
env: | ||
URL: ${{ github.event.pull_request.comments_url }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
PRE_COMMIT: ${{ env.pre_commit_mod }} | ||
run: | | ||
curl \ | ||
-X POST \ | ||
$URL \ | ||
-H "Content-Type: application/json" \ | ||
-H "Authorization: token $GITHUB_TOKEN" \ | ||
--data "{ \"body\": \"$PRE_COMMIT\" }" | ||
- name: pre-commit exit code | ||
env: | ||
EXIT_CODE: ${{ env.exit_code }} | ||
run: exit $EXIT_CODE |
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,3 +1,5 @@ | ||
**~ | ||
**.swp | ||
.DS_STORE | ||
.idea | ||
*.bkp | ||
|
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,8 +1,8 @@ | ||
[submodule "dash-pipeline/SAI/SAI"] | ||
path = dash-pipeline/SAI/SAI | ||
url = https://github.com/reshmaintel/SAI.git | ||
branch = dash-ptf-ci | ||
url = https://github.com/opencomputeproject/SAI.git | ||
branch = master | ||
[submodule "test/SAI-Challenger"] | ||
path = test/SAI-Challenger | ||
url = https://github.com/opencomputeproject/SAI-Challenger | ||
url = https://github.com/opencomputeproject/SAI-Challenger.git | ||
branch = main |
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,19 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
hooks: | ||
- id: mixed-line-ending | ||
args: [--fix=lf] | ||
# - id: trailing-whitespace | ||
# - id: end-of-file-fixer | ||
# - id: check-case-conflict | ||
# - id: check-ast | ||
# - id: check-json | ||
# - id: double-quote-string-fixer | ||
# - repo: https://github.com/PyCQA/flake8 | ||
# rev: 6.0.0 | ||
# hooks: | ||
# - id: flake8 | ||
# args: ["--max-line-length=201", "--extend-ignore=F601,F821"] |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.