Browse Source

Merge pull request #2 from modelscope/feat/ci

feat: add citest
master
Yingda Chen GitHub 3 years ago
parent
commit
056c7fd369
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 92 additions and 1 deletions
  1. +5
    -1
      .dev_scripts/ci_container_test.sh
  2. +64
    -0
      .github/workflows/citest.yaml
  3. +22
    -0
      .github/workflows/lint.yaml
  4. +1
    -0
      tests/run_config.yaml

+ 5
- 1
.dev_scripts/ci_container_test.sh View File

@@ -6,10 +6,14 @@ awk -F: '/^[^#]/ { print $1 }' requirements/nlp.txt | xargs -n 1 pip install -f
pip install -r requirements/tests.txt

git config --global --add safe.directory /Maas-lib
git config --global user.email tmp
git config --global user.name tmp.com

# linter test
# 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
echo "linter test failed, please run 'pre-commit run --all-files' to check"
exit -1


+ 64
- 0
.github/workflows/citest.yaml View File

@@ -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

+ 22
- 0
.github/workflows/lint.yaml View File

@@ -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

+ 1
- 0
tests/run_config.yaml View File

@@ -10,6 +10,7 @@ isolated: # test cases that may require excessive anmount of GPU memory, which
- test_easycv_trainer.py
- test_segformer.py
- test_segmentation_pipeline.py
- test_movie_scene_segmentation.py

envs:
default: # default env, case not in other env will in default, pytorch.


Loading…
Cancel
Save