add ditorch and op_tool config file (#71) #297
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
name: runs on ascend | |
on: | |
workflow_dispatch: | |
inputs: | |
run_test_use_pytorch: | |
description: 'Run Test_use_pytorch job' | |
required: true | |
default: 'false' | |
type: boolean | |
push: | |
branches: | |
- main | |
tags: | |
- 'v*' | |
pull_request: | |
env: | |
DEEPLINK_PATH: '/mnt/cache/share/deeplinkci/github/${{ github.repository }}' | |
concurrency: | |
group: ascend-${{ github.head_ref || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
Checkout_Code: | |
name: checkout code | |
runs-on: tps-ascend-ci-910b | |
steps: | |
- name: Checkout Code | |
uses: DeepLink-org/ditorch/.github/actions/checkout-code@main | |
Build: | |
name: build on ascend | |
runs-on: tps-ascend-ci-910b | |
needs: [checkout_code] | |
steps: | |
- name: build | |
run: | | |
set -ex | |
cd ${DEEPLINK_PATH}/${GITHUB_RUN_NUMBER} && rm -rf ${GITHUB_JOB} && cp -R source ${GITHUB_JOB} && cd ${GITHUB_JOB} | |
echo "start to build" | |
bash ci/lint.sh | |
Test: | |
name: test on ascend | |
runs-on: tps-ascend-ci-910b | |
needs: [Build] | |
steps: | |
- name: test | |
run: | | |
set -ex | |
source /mnt/cache/share/platform/cienv/ditorch_env | |
cd ${DEEPLINK_PATH}/${GITHUB_RUN_NUMBER} && rm -rf ${GITHUB_JOB} && cp -R Build ${GITHUB_JOB} && cd ${GITHUB_JOB} | |
export PYTHONPATH=${PYTHONPATH}:$PWD | |
echo "start to test" | |
bash ci/run_op_tools_test_cases.sh | |
Test_use_pytorch_test_case: | |
name: run pytorch test case on ascend | |
runs-on: tps-ascend-ci-910b | |
if: ${{ github.event.inputs.run_test_use_pytorch == 'true' }} | |
needs: [Build] | |
steps: | |
- name: test | |
run: | | |
set -ex | |
source /mnt/cache/share/platform/cienv/ditorch_env | |
cd ${DEEPLINK_PATH}/${GITHUB_RUN_NUMBER} && rm -rf ${GITHUB_JOB} && cp -R Build ${GITHUB_JOB} && cd ${GITHUB_JOB} | |
export PYTHONPATH=${PYTHONPATH}:$PWD | |
echo "start to test" | |
bash ci/run_pytorch_test_cases.sh 2>&1 |