From bfa1b66d4c7f4d593d2780c4584f48ca196a4eef Mon Sep 17 00:00:00 2001 From: yangbofun Date: Wed, 8 May 2024 20:50:06 +0800 Subject: [PATCH 1/5] modify ci --- .github/workflows/static.yml | 72 +++++++++++++++++------------------- 1 file changed, 33 insertions(+), 39 deletions(-) diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 5fa33a04..f4bb330e 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -18,11 +18,11 @@ concurrency: cancel-in-progress: true jobs: - static-checks-on-sco-nvidia: - name: static checks on nv - runs-on: tps-sco-ci + Rsync: + name: Rsync code + runs-on: [tps-diopi-ci, tps-ascend-ci-910b] steps: - - name: setting up environment + - name: clone repo run: | set -euxo pipefail set_env() { @@ -33,6 +33,7 @@ jobs: set_env CODE_SOURCE "${WORKSPACE}/source" set_env CLANGD_TIDY_SOURCE "${WORKSPACE}/clangd-tidy" set_env CLANGD_TIDY_LOG "${WORKSPACE}/clang-tidy.log" + - name: clean obsolete workspaces & prepare workspace run: | set -euxo pipefail @@ -41,32 +42,37 @@ jobs: rm -rf ${WORKSPACE} find ${DEEPLINK_PATH} -mindepth 1 -maxdepth 1 -mmin +480 -type d -exec bash -c 'echo clean "$0" && rm -rf "$0"' {} \; mkdir -p ${WORKSPACE} - - name: checkout code - run: | - set -euo pipefail - source ${PROXY_SOURCE} - set -x - 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 }} + - name: checkout code + run: | + set -euo pipefail + source ${PROXY_SOURCE} + set -x + 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 checkout ${{ github.sha }} + 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 - fi - git submodule update --init --recursive + git submodule update --init --recursive - name: checkout clangd-tidy run: | set -euo pipefail source ${PROXY_SOURCE} set -x git -c advice.detachedHead=false clone --depth 1 -b v0.1.3 https://github.com/lljbash/clangd-tidy.git ${CLANGD_TIDY_SOURCE} + + build-on-nv: + - name: build and static check on nv + runs-on: [tps-diopi-ci] + steps: - name: build run: | set -euxo pipefail @@ -81,30 +87,18 @@ jobs: set -euxo pipefail rm -rf ${CODE_SOURCE}/build/.cache - build-on-ascend: - name: build on ascend + build-check-test-on-ascend: + name: build, static check, test on ascend runs-on: tps-ascend-ci-910b + needs: [Rsync] steps: - - name: prepare code - run: | - set -ex - rm ${DEEPLINK_PATH}/${{ github.run_number }}/* -rf - mkdir -p ${DEEPLINK_PATH}/${{ github.run_number }} && cd ${DEEPLINK_PATH}/${{ github.run_number }} - git clone https://github.com/DeepLink-org/DeepLinkExt.git && cd DeepLinkExt - git checkout ${{ github.event.pull_request.head.sha }} && git merge --no-edit ${{ github.base_ref }} - name: build deeplink_ext run: | source /mnt/cache/share/platform/cienv/dipu_latest_ci cd ${DEEPLINK_PATH}/${{ github.run_number }}/DeepLinkExt python setup.py build_ext --inplace - - test-on-ascend: - name: test on ascend - runs-on: tps-ascend-ci-910b - needs: [build-on-ascend] - steps: - - name: run unit tests on ascend + - name: test run: | source /mnt/cache/share/platform/cienv/dipu_latest_ci cd ${DEEPLINK_PATH}/${{ github.run_number }}/DeepLinkExt - python -m pytest tests \ No newline at end of file + python -m pytest tests From a1444a338f7e22229c3497085820e8d08e360e54 Mon Sep 17 00:00:00 2001 From: yangbofun Date: Wed, 8 May 2024 20:57:52 +0800 Subject: [PATCH 2/5] fix error --- .github/workflows/static.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index f4bb330e..a6df8bb8 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -70,8 +70,8 @@ jobs: git -c advice.detachedHead=false clone --depth 1 -b v0.1.3 https://github.com/lljbash/clangd-tidy.git ${CLANGD_TIDY_SOURCE} build-on-nv: - - name: build and static check on nv runs-on: [tps-diopi-ci] + name: build and static check on nv steps: - name: build run: | From d57de7a9768efc7048d5bcceef7cda60c22f2732 Mon Sep 17 00:00:00 2001 From: yangbofun Date: Wed, 8 May 2024 21:00:06 +0800 Subject: [PATCH 3/5] update --- .github/workflows/static.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index a6df8bb8..e43bd8b7 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -70,8 +70,9 @@ jobs: git -c advice.detachedHead=false clone --depth 1 -b v0.1.3 https://github.com/lljbash/clangd-tidy.git ${CLANGD_TIDY_SOURCE} build-on-nv: - runs-on: [tps-diopi-ci] name: build and static check on nv + runs-on: [tps-diopi-ci] + needs: [Rsync] steps: - name: build run: | From 49a909fc3535e875ac415ab9b2105246c630ad8d Mon Sep 17 00:00:00 2001 From: yangbofun Date: Wed, 8 May 2024 21:40:55 +0800 Subject: [PATCH 4/5] update --- .github/workflows/static.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index e43bd8b7..a6da3fde 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -20,7 +20,7 @@ concurrency: jobs: Rsync: name: Rsync code - runs-on: [tps-diopi-ci, tps-ascend-ci-910b] + runs-on: [tps-sco-ci, tps-ascend-ci-910b] steps: - name: clone repo run: | From 3201380951087dcd77a3922684b685d184c17d37 Mon Sep 17 00:00:00 2001 From: yangbofun Date: Wed, 8 May 2024 21:45:01 +0800 Subject: [PATCH 5/5] update --- .github/workflows/static.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index a6da3fde..7087b3f5 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -20,7 +20,7 @@ concurrency: jobs: Rsync: name: Rsync code - runs-on: [tps-sco-ci, tps-ascend-ci-910b] + runs-on: self-hosted steps: - name: clone repo run: |