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

ci: modify ci #107

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
73 changes: 34 additions & 39 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: self-hosted
steps:
- name: setting up environment
- name: clone repo
run: |
set -euxo pipefail
set_env() {
Expand All @@ -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
Expand All @@ -41,32 +42,38 @@ 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]
needs: [Rsync]
steps:
- name: build
run: |
set -euxo pipefail
Expand All @@ -81,30 +88,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
python -m pytest tests
Loading