Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(CI): update api check rules #696

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 28 additions & 4 deletions .github/workflows/api-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
jobs:
Check-Api-Change:
runs-on: ubuntu-latest
outputs:
isFail: ${{ steps.check-api.outputs.isFail }}
steps:
- name: install tools
run: |
Expand Down Expand Up @@ -43,18 +45,40 @@
fi
fi
- name: check api
id: check-api
run: |
./deepin-abigail -c fastFilesCompare.json | tee api_check.txt
if [ -e 'api_check.txt' ];then
check_num=$(cat api_check.txt | grep -c '\[Chg_exprort_fun\|\[Del_export_fun' || true)
echo "CHECK_NUM=$check_num" >> $GITHUB_ENV
if [ $check_num -gt 0 ];then
sed -i '1i API接口检查检测到存在对外接口删除:' api_check.txt
echo "isFail=true" >> $GITHUB_OUTPUT
sed -i '1i API接口检查检测到存在对外接口删除和修改:' api_check.txt
sed -i '1i [API接口检查]' api_check.txt
exit 1
fi
fi
- name: upload artifact
if: always() && steps.check-api.outputs.isFail == 'true'
uses: actions/upload-artifact@v4
with:
name: api-check-report
path: api_check.txt
Post-Check:
runs-on: ubuntu-latest
needs: Check-Api-Change
continue-on-error: true
if: needs.Check-Api-Change.outputs.isFail == 'true' && failure()
steps:
- name: download artifact
uses: actions/download-artifact@v4
with:
name: api-check-report
- name: Comment PR
if: always() && env.CHECK_NUM > 0
uses: thollander/actions-comment-pull-request@v2
with:
filePath: api_check.txt
filePath: api_check.txt
- name: Add Reviewers to Pull Request
uses: ryaugusta/pr-add-reviewers-action@v1
with:
token: ${{ github.token }}

Check warning on line 83 in .github/workflows/api-check.yml

View workflow job for this annotation

GitHub Actions / validate-yaml

83:13 [indentation] wrong indentation: expected 10 but found 12
reviewers: liujianqiang-niu

Check warning on line 84 in .github/workflows/api-check.yml

View workflow job for this annotation

GitHub Actions / validate-yaml

84:40 [new-line-at-end-of-file] no new line character at the end of file
8 changes: 5 additions & 3 deletions .github/workflows/static-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,11 @@
path: staticCheck
- if: hashFiles('.golangci.yml') == ''
run: mv staticCheck/staticCheck/golangci.yml .golangci.yml
- name: GolangCILint Check
uses: golangci/golangci-lint-action@v6
- uses: golangci/golangci-lint-action@v6
continue-on-error: true
with:
version: v1.58
version: latest
args: --timeout=30m --out-format=junit-xml
only-new-issues: true
Call-CppCheck:
runs-on: ubuntu-latest
Expand All @@ -104,13 +105,14 @@
runs-on: ubuntu-latest
needs: Get-Config
if: needs.Get-Config.outputs.isShell == 'true'
steps:

Check warning on line 108 in .github/workflows/static-check.yml

View workflow job for this annotation

GitHub Actions / validate-yaml

108:11 [trailing-spaces] trailing spaces
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
- uses: pr-annotators/shellcheck-pr-annotator@main
- uses: ludeeus/action-shellcheck@master
continue-on-error: true
with:
severity: error
format: gcc

Check warning on line 118 in .github/workflows/static-check.yml

View workflow job for this annotation

GitHub Actions / validate-yaml

118:22 [new-line-at-end-of-file] no new line character at the end of file
Loading