Skip to content

Commit

Permalink
chore(CI): update api check rules
Browse files Browse the repository at this point in the history
  update api check rules

Log: 更新api检查审核机制
  • Loading branch information
kuchune authored and myml committed Sep 4, 2024
1 parent 26e8f24 commit a190a76
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 7 deletions.
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 @@ on: workflow_call
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 @@ jobs:
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 }}
reviewers: liujianqiang-niu
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 @@ jobs:
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 Down Expand Up @@ -111,6 +112,7 @@ jobs:
persist-credentials: false
- uses: pr-annotators/shellcheck-pr-annotator@main
- uses: ludeeus/action-shellcheck@master
continue-on-error: true
with:
severity: error
format: gcc

0 comments on commit a190a76

Please sign in to comment.