-
Notifications
You must be signed in to change notification settings - Fork 198
153 lines (144 loc) · 4.52 KB
/
ci_pipeline.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: CI Pipe
on:
pull_request:
branches: [ "master" ]
paths:
- 'mindnlp/**'
- 'tests/**'
- '!mindnlp/dataset/**'
- '!tests/dataset/**'
- '!docs/**'
- '.github/workflows/**'
push:
branches: [ "master" ]
paths:
- 'mindnlp/**'
- '!mindnlp/dataset/**'
- '!docs/**'
permissions:
contents: read
jobs:
pylint-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip==24.0
pip install -r requirements/requirements.txt
- name: Install MindSpore
shell: bash
env:
OS: ubuntu-latest
PYTHON: 3.9
run: |
python .github/install_mindspore.py
pip install -r download.txt
- name: Analysing the mindnlp code with pylint
run: |
NUM_CORES=$(nproc)
pylint --jobs=$NUM_CORES mindnlp --rcfile=.github/pylint.conf
ut-test:
needs: pylint-check
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: [3.9]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: avoid macos error
if: matrix.os == 'macos-latest'
run: rm -rf $RUNNER_TOOL_CACHE/Python/3.8.17
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip==24.0
pip install -r requirements/requirements.txt
- name: Install MindSpore
shell: bash
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python }}
run: |
python .github/install_mindspore.py
pip install -r download.txt
- name: Test with pytest
run: |
pytest -c pytest.ini -m 'not download and not gpu_only' --ignore=tests/transformers tests/ut
release-test:
needs: pylint-check
strategy:
matrix:
ms_version: ['2.2.14', '2.3.1']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip==24.0
pip install -r requirements/requirements.txt
- name: Install MindSpore
shell: bash
run: |
pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/${{matrix.ms_version}}/MindSpore/unified/x86_64/mindspore-${{matrix.ms_version}}-cp39-cp39-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com
- name: Test with pytest
run: |
pytest -c pytest.ini -m 'not download and not gpu_only' --ignore=tests/transformers tests/ut
# pytest -c pytest.ini -m 'not download and not gpu_only' tests/ut
transformers-model-test:
needs: pylint-check
strategy:
matrix:
alpha: ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip==24.0
pip install -r requirements/requirements.txt
- name: Install MindSpore
shell: bash
env:
OS: ubuntu-latest
PYTHON: 3.9
run: |
python .github/install_mindspore.py
pip install -r download.txt
- name: Test with pytest
run: |
pytest -vs tests/transformers/models/${{ matrix.alpha }}*/test_modeling*
kaggle-gpu-test:
needs: pylint-check
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.repository_owner == 'mindspore-lab'
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- uses: "lvyufeng/action-kaggle-gpu-test@latest"
with:
kaggle_username: "${{ secrets.KAGGLE_USERNAME }}"
kaggle_key: "${{ secrets.KAGGLE_API_KEY }}"
kernel_name: mindnlp
kernel_job_file: .github/kaggle_gpu_test.py