| @@ -6,10 +6,14 @@ awk -F: '/^[^#]/ { print $1 }' requirements/nlp.txt | xargs -n 1 pip install -f | |||||
| pip install -r requirements/tests.txt | pip install -r requirements/tests.txt | ||||
| git config --global --add safe.directory /Maas-lib | git config --global --add safe.directory /Maas-lib | ||||
| git config --global user.email tmp | |||||
| git config --global user.name tmp.com | |||||
| # linter test | # linter test | ||||
| # use internal project for pre-commit due to the network problem | # use internal project for pre-commit due to the network problem | ||||
| pre-commit run -c .pre-commit-config_local.yaml --all-files | |||||
| if [ `git remote -v | grep alibaba | wc -l` -gt 1 ]; then | |||||
| pre-commit run -c .pre-commit-config_local.yaml --all-files | |||||
| fi | |||||
| if [ $? -ne 0 ]; then | if [ $? -ne 0 ]; then | ||||
| echo "linter test failed, please run 'pre-commit run --all-files' to check" | echo "linter test failed, please run 'pre-commit run --all-files' to check" | ||||
| exit -1 | exit -1 | ||||
| @@ -0,0 +1,64 @@ | |||||
| name: citest | |||||
| on: | |||||
| push: | |||||
| branches: | |||||
| - master | |||||
| - "release/**" | |||||
| paths-ignore: | |||||
| - "setup.*" | |||||
| - "requirements.txt" | |||||
| - "requirements/**" | |||||
| - "docs/**" | |||||
| - "tools/**" | |||||
| - ".dev_scripts/**" | |||||
| - "README.md" | |||||
| - "README_zh-CN.md" | |||||
| - "NOTICE" | |||||
| - ".github/workflows/lint.yaml" | |||||
| - ".github/workflows/publish.yaml" | |||||
| pull_request: | |||||
| paths-ignore: | |||||
| - "setup.*" | |||||
| - "requirements.txt" | |||||
| - "requirements/**" | |||||
| - "docs/**" | |||||
| - "tools/**" | |||||
| - ".dev_scripts/**" | |||||
| - "README.md" | |||||
| - "README_zh-CN.md" | |||||
| - "NOTICE" | |||||
| - ".github/workflows/lint.yaml" | |||||
| - ".github/workflows/publish.yaml" | |||||
| concurrency: | |||||
| group: ${{ github.workflow }}-${{ github.ref }} | |||||
| cancel-in-progress: true | |||||
| jobs: | |||||
| unittest: | |||||
| # The type of runner that the job will run on | |||||
| runs-on: [modelscope-self-hosted] | |||||
| steps: | |||||
| - name: ResetFileMode | |||||
| shell: bash | |||||
| run: | | |||||
| # reset filemode to allow action runner to delete files | |||||
| # generated by root in docker | |||||
| set -e | |||||
| source ~/.bashrc | |||||
| sudo chown -R $USER:$USER $ACTION_RUNNER_DIR | |||||
| - name: Checkout | |||||
| uses: actions/checkout@v2 | |||||
| with: | |||||
| lfs: 'true' | |||||
| - name: Checkout LFS objects | |||||
| run: git lfs checkout | |||||
| - name: Run unittest | |||||
| shell: bash | |||||
| run: | | |||||
| set -e | |||||
| source /mnt/modelscope/ci_env.sh | |||||
| bash .dev_scripts/dockerci.sh | |||||
| @@ -0,0 +1,22 @@ | |||||
| name: Lint test | |||||
| on: [push, pull_request] | |||||
| concurrency: | |||||
| group: ${{ github.workflow }}-${{ github.ref }} | |||||
| cancel-in-progress: true | |||||
| jobs: | |||||
| lint: | |||||
| runs-on: ubuntu-latest | |||||
| steps: | |||||
| - uses: actions/checkout@v2 | |||||
| - name: Set up Python 3.6 | |||||
| uses: actions/setup-python@v2 | |||||
| with: | |||||
| python-version: 3.6 | |||||
| - name: Install pre-commit hook | |||||
| run: | | |||||
| pip install pre-commit | |||||
| - name: Linting | |||||
| run: pre-commit run --all-files | |||||
| @@ -10,6 +10,7 @@ isolated: # test cases that may require excessive anmount of GPU memory, which | |||||
| - test_easycv_trainer.py | - test_easycv_trainer.py | ||||
| - test_segformer.py | - test_segformer.py | ||||
| - test_segmentation_pipeline.py | - test_segmentation_pipeline.py | ||||
| - test_movie_scene_segmentation.py | |||||
| envs: | envs: | ||||
| default: # default env, case not in other env will in default, pytorch. | default: # default env, case not in other env will in default, pytorch. | ||||