mirror of
https://github.com/modelscope/modelscope.git
synced 2025-12-24 12:09:22 +01:00
77 lines
2.0 KiB
YAML
77 lines
2.0 KiB
YAML
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_*.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-us]
|
|
timeout-minutes: 240
|
|
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@v3
|
|
with:
|
|
lfs: 'false'
|
|
submodules: 'true'
|
|
fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }}
|
|
- name: Get changed files
|
|
id: changed-files
|
|
run: |
|
|
if ${{ github.event_name == 'pull_request' }}; then
|
|
echo "PR_CHANGED_FILES=$(git diff --name-only -r HEAD^1 HEAD | xargs)" >> $GITHUB_ENV
|
|
else
|
|
echo "PR_CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | xargs)" >> $GITHUB_ENV
|
|
fi
|
|
- name: Fetch LFS objects
|
|
run: |
|
|
git lfs pull
|
|
- name: Run unittest
|
|
shell: bash
|
|
run: |
|
|
set -e
|
|
source /mnt/modelscope/ci_env.sh
|
|
bash .dev_scripts/dockerci.sh
|