mirror of https://github.com/InternLM/InternLM
test(ci_scripts): add install requirements automaticlly,trigger event about lint check and other optimizations (#174)
* add pull_request in lint check * use default variables in ci_scripts * fix format * check and install requirements automaticlly * fix format --------- Co-authored-by: qa-caif-cicd <qa-caif-cicd@pjlab.org.cn>pull/178/head
parent
585071c95b
commit
06274e64d7
|
@ -3,13 +3,33 @@ on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- "main"
|
- "main"
|
||||||
- "develop"
|
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- "docs/**"
|
- "docs/**"
|
||||||
- "**.md"
|
- "**.md"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
check-requirements:
|
||||||
|
runs-on: [lmtest]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 2
|
||||||
|
- name: check-requirements
|
||||||
|
run: |
|
||||||
|
source activate internlm-env-test
|
||||||
|
changed_files=$(git diff --name-only -r HEAD^1 HEAD)
|
||||||
|
echo $changed_files
|
||||||
|
if [[ $changed_files =~ "runtime.txt" ]]; then
|
||||||
|
pip install -r requirements/runtime.txt
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $changed_files =~ "torch.txt" ]]; then
|
||||||
|
pip install -r requirements/torch.txt
|
||||||
|
fi
|
||||||
|
|
||||||
dataset-preparation:
|
dataset-preparation:
|
||||||
|
if: ${{ always() }}
|
||||||
|
needs: check-requirements
|
||||||
runs-on: [lmtest]
|
runs-on: [lmtest]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
@ -24,8 +44,9 @@ jobs:
|
||||||
source activate internlm-env-test
|
source activate internlm-env-test
|
||||||
sh ./ci_scripts/data/tokenizer_alpaca.sh
|
sh ./ci_scripts/data/tokenizer_alpaca.sh
|
||||||
|
|
||||||
|
|
||||||
train:
|
train:
|
||||||
|
if: ${{ always() }}
|
||||||
|
needs: check-requirements
|
||||||
runs-on: [lmtest]
|
runs-on: [lmtest]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
@ -43,6 +64,8 @@ jobs:
|
||||||
rm -rf $GITHUB_WORKSPACE/llm_ckpts
|
rm -rf $GITHUB_WORKSPACE/llm_ckpts
|
||||||
|
|
||||||
convert-model-then-load:
|
convert-model-then-load:
|
||||||
|
if: ${{ always() }}
|
||||||
|
needs: check-requirements
|
||||||
runs-on: [lmtest]
|
runs-on: [lmtest]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
@ -58,6 +81,8 @@ jobs:
|
||||||
rm -rf $GITHUB_WORKSPACE/hf_ckpt
|
rm -rf $GITHUB_WORKSPACE/hf_ckpt
|
||||||
|
|
||||||
load-chat-model-in-hf:
|
load-chat-model-in-hf:
|
||||||
|
if: ${{ always() }}
|
||||||
|
needs: check-requirements
|
||||||
runs-on: [lmtest]
|
runs-on: [lmtest]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
|
@ -1,6 +1,11 @@
|
||||||
name: lint-check
|
name: lint-check
|
||||||
|
|
||||||
on: [push]
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- "main"
|
||||||
|
- "develop"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# lint check can be auto-executed by the workflow
|
# lint check can be auto-executed by the workflow
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# TODO: variable defination should be in repo configures.
|
readonly DATA_VOLUME=$(echo $GITHUB_WORKSPACE | cut -d '/' -f 1-4)/data
|
||||||
readonly DATA_VOLUME=${DATA_VOLUME:-"/mnt/petrelfs/qa-caif-cicd/data"}
|
|
||||||
|
|
Loading…
Reference in New Issue