-
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
7 changed files
with
102 additions
and
35 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
CompileFlags: | ||
Remove: -fabi* | ||
Diagnostics: | ||
UnusedIncludes: Strict | ||
MissingIncludes: Strict |
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,72 @@ | ||
name: static checks on sco | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
env: | ||
ENV_SOURCE: /mnt/cache/share/platform/env/dipu_latest | ||
PROXY_SOURCE: /mnt/cache/share/platform/env/proxy | ||
WORKSPACE: /mnt/cache/share/deeplinkci/github/${{ github.repository }}/${{ github.run_number }} | ||
CODE_SOURCE: source | ||
CLANGD_TIDY_SOURCE: clangd-tidy | ||
CLANGD_EXEC: /mnt/cache/share/platform/dep/clang-17/bin/clangd | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
checkout-code: | ||
name: checkout code | ||
runs-on: tps-sco-ci | ||
steps: | ||
- name: prepare workspace | ||
run: | | ||
set -euxo pipefail | ||
mkdir -p ${WORKSPACE} && cd ${WORKSPACE} && pwd | ||
- name: checkout code | ||
run: | | ||
set -euo pipefail | ||
source ${PROXY_SOURCE} | ||
set -x | ||
cd ${WORKSPACE} && pwd | ||
[[ ! -d ${CODE_SOURCE} ]] || rm -rf ${CODE_SOURCE} | ||
if [ -n "${{ github.event.pull_request.head.repo.full_name }}" ] && [[ ! "${{ github.event.pull_request.head.repo.full_name }}" == "${{ github.repository }}" ]]; then | ||
git clone ${{ github.event.pull_request.head.repo.clone_url }} ${CODE_SOURCE} | ||
cd ${CODE_SOURCE} && git checkout ${{ github.event.pull_request.head.sha }} | ||
git remote add mainrepo https://github.com/${{ github.repository }}.git | ||
git fetch mainrepo && git merge --no-edit mainrepo/${{ github.base_ref }} | ||
else | ||
git clone ${{ github.event.repository.clone_url }} ${CODE_SOURCE} && cd ${CODE_SOURCE} | ||
if [ "${{ github.event_name }}" == "pull_request" ]; then | ||
git checkout ${{ github.event.pull_request.head.sha }} && git merge --no-edit ${{ github.base_ref }} | ||
else | ||
git checkout ${{ github.sha }} | ||
fi | ||
fi | ||
git submodule update --init --recursive | ||
- name: checkout clangd-tidy | ||
run: | | ||
set -euo pipefail | ||
source ${PROXY_SOURCE} | ||
set -x | ||
cd ${WORKSPACE}/${CODE_SOURCE} && pwd | ||
git -c advice.detachedHead=false clone --depth 1 -b v0.1.3 https://github.com/lljbash/clangd-tidy.git ${CLANGD_TIDY_SOURCE} | ||
build-and-tidy: | ||
name: build and tidy | ||
runs-on: tps-sco-ci | ||
needs: [checkout-code] | ||
steps: | ||
- name: build | ||
run: | | ||
set -euxo pipefail | ||
srun --job-name=${GITHUB_JOB} bash -c "source ${ENV_SOURCE} && cd ${WORKSPACE}/${CODE_SOURCE} && pwd && pip install -e . -v -t install" | ||
- name: clang-tidy | ||
run: | | ||
set -euxo pipefail | ||
srun --job-name=${GITHUB_JOB} bash -c "source ${ENV_SOURCE} && cd ${WORKSPACE}/${CODE_SOURCE} && pwd && git ls-files csrc | xargs ${CLANGD_TIDY_SOURCE}/clangd-tidy --clangd-executable=${CLANGD_EXEC} --github --git-root=${WORKSPACE}/${CODE_SOURCE} -j4 -o clang-tidy.log" || (cat ${WORKSPACE}/${CODE_SOURCE}/clang-tidy.log && false) |
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