11name : pr_stage_test
22
3+ env :
4+ ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION : true
5+
6+
37on :
48 pull_request :
59 paths-ignore :
@@ -21,152 +25,114 @@ concurrency:
2125jobs :
2226 build_cpu :
2327 runs-on : ubuntu-22.04
28+ defaults :
29+ run :
30+ shell : bash -l {0}
2431 strategy :
2532 matrix :
26- python-version : [3.7]
27- include :
28- - torch : 1.8.1
29- torchvision : 0.9.1
33+ python-version : ['3.9']
34+ torch : ['2.0.0']
3035 steps :
31- - uses : actions/checkout@v3
32- - name : Set up Python ${{ matrix.python-version }}
33- uses : actions/setup-python@v4
36+ - name : Check out repo
37+ uses : actions/checkout@v3
38+ - name : Setup conda env
39+ uses : conda-incubator/setup-miniconda@v2
3440 with :
41+ auto-update-conda : true
42+ miniconda-version : " latest"
43+ use-only-tar-bz2 : true
44+ activate-environment : test
3545 python-version : ${{ matrix.python-version }}
36- - name : Upgrade pip
37- run : python -m pip install pip --upgrade
38- - name : Upgrade wheel
39- run : python -m pip install wheel --upgrade
40- - name : Install PyTorch
41- run : pip install torch==${{matrix.torch}}+cpu torchvision==${{matrix.torchvision}}+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html
42- - name : Build MMEngine from source
43- run : pip install -e . -v
44- - name : Install unit tests dependencies
46+ - name : Update pip
4547 run : |
46- pip install -r requirements/tests.txt
47- pip install openmim
48- mim install mmcv
49- - name : Run unittests and generate coverage report
48+ python -m pip install --upgrade pip wheel
49+ - name : Install dependencies
5050 run : |
51- coverage run --branch --source mmengine -m pytest tests/ --ignore tests/test_dist
52- coverage xml
53- coverage report -m
54- # Upload coverage report for python3.7 && pytorch1.8.1 cpu
55- - name : Upload coverage to Codecov
51+ apt-get update && apt-get install -y ffmpeg libsm6 libxext6 git ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6
52+ python -m pip install torch==${{matrix.torch}}
53+ python -m pip install -e . -v
54+ python -m pip install -r requirements/tests.txt
55+ python -m pip install openmim
56+ mim install mmcv coverage
57+ - name : Run unit tests with coverage
58+ run : coverage run --branch --source mmengine -m pytest tests/ --ignore tests/test_dist
59+ - name : Upload Coverage to Codecov
5660 uses : codecov/codecov-action@v3
57- with :
58- file : ./coverage.xml
59- flags : unittests
60- env_vars : OS,PYTHON
61- name : codecov-umbrella
62- fail_ci_if_error : false
6361
64- build_cu102 :
62+ build_gpu :
6563 runs-on : ubuntu-22.04
66- container :
67- image : pytorch/pytorch:1.8.1-cuda10.2-cudnn7-devel
64+ defaults :
65+ run :
66+ shell : bash -l {0}
6867 env :
6968 MKL_THREADING_LAYER : GNU
7069 strategy :
7170 matrix :
72- python-version : [3.7]
71+ python-version : ['3.9','3.10']
72+ torch : ['2.0.0','2.3.1','2.5.1']
73+ cuda : ['cu118']
7374 steps :
74- - uses : actions/checkout@v3
75- - name : Set up Python ${{ matrix.python-version }}
76- uses : actions/setup-python@v4
75+ - name : Check out repo
76+ uses : actions/checkout@v3
77+ - name : Setup conda env
78+ uses : conda-incubator/setup-miniconda@v2
7779 with :
80+ auto-update-conda : true
81+ miniconda-version : " latest"
82+ use-only-tar-bz2 : true
83+ activate-environment : test
7884 python-version : ${{ matrix.python-version }}
79- - name : Upgrade pip
80- run : pip install pip --upgrade
81- - name : Fetch GPG keys
85+ - name : Update pip
8286 run : |
83- apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub
84- apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub
85- - name : Install system dependencies
86- run : apt-get update && apt-get install -y ffmpeg libsm6 libxext6 git ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6
87- - name : Build MMEngine from source
88- run : pip install -e . -v
89- - name : Install unit tests dependencies
87+ python -m pip install --upgrade pip wheel
88+ - name : Install dependencies
9089 run : |
91- pip install -r requirements/tests.txt
92- pip install openmim
93- mim install mmcv
94- - name : Run unittests and generate coverage report
95- run : |
96- coverage run --branch --source mmengine -m pytest tests/ --ignore tests/test_dist
97- coverage xml
98- coverage report -m
99-
100- build_cu117 :
101- runs-on : ubuntu-22.04
102- container :
103- image : pytorch/pytorch:2.0.0-cuda11.7-cudnn8-devel
104- strategy :
105- matrix :
106- python-version : [3.9]
107- steps :
108- - uses : actions/checkout@v3
109- - name : Set up Python ${{ matrix.python-version }}
110- uses : actions/setup-python@v4
111- with :
112- python-version : ${{ matrix.python-version }}
113- - name : Upgrade pip
114- run : pip install pip --upgrade
115- - name : Fetch GPG keys
116- run : |
117- apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub
118- apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub
119- - name : Install system dependencies
120- run : apt-get update && apt-get install -y git ffmpeg libturbojpeg
121- - name : Build MMEngine from source
122- run : pip install -e . -v
123- - name : Install unit tests dependencies
124- run : |
125- pip install -r requirements/tests.txt
126- pip install openmim
127- mim install mmcv
128- # Distributed related unit test may randomly error in PyTorch 1.13.0
129- - name : Run unittests and generate coverage report
130- run : |
131- coverage run --branch --source mmengine -m pytest tests/ --ignore tests/test_dist/
132- coverage xml
133- coverage report -m
90+ apt-get update && apt-get install -y ffmpeg libsm6 libxext6 git ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6
91+ python -m pip install torch==${{matrix.torch}} --index-url https://download.pytorch.org/whl/${{matrix.cuda}}
92+ python -m pip install -e . -v
93+ python -m pip install -r requirements/tests.txt
94+ python -m pip install openmim
95+ mim install mmcv coverage
96+ - name : Run unit tests with coverage
97+ run : coverage run --branch --source mmengine -m pytest tests/ --ignore tests/test_dist
98+ - name : Upload Coverage to Codecov
99+ uses : codecov/codecov-action@v3
134100
135- build_windows :
136- runs-on : windows-2022
137- strategy :
138- matrix :
139- python-version : [3.7 ]
140- platform : [cpu, cu111]
141- torch : [1.8.1]
142- torchvision : [0.9.1]
143- include :
144- - python-version : 3.8
145- platform : cu118
146- torch : 2.1.0
147- torchvision : 0.16.0
148- steps :
149- - uses : actions/checkout@v3
150- - name : Set up Python ${{ matrix.python-version }}
151- uses : actions/setup-python@v4
152- with :
153- python-version : ${{ matrix.python-version }}
154- - name : Upgrade pip
155- # Windows CI could fail If we call `pip install pip --upgrade` directly.
156- run : python -m pip install pip --upgrade
157- - name : Install PyTorch
158- run : pip install torch==${{matrix.torch}}+${{matrix.platform}} torchvision==${{matrix.torchvision}}+${{matrix.platform}} -f https://download.pytorch.org/whl/${{matrix.platform}}/torch_stable.html
159- - name : Build MMEngine from source
160- run : pip install -e . -v
161- - name : Install unit tests dependencies
162- run : |
163- pip install -r requirements/tests.txt
164- pip install openmim
165- mim install mmcv
166- - name : Run CPU unittests
167- run : pytest tests/ --ignore tests/test_dist
168- if : ${{ matrix.platform == 'cpu' }}
169- - name : Run GPU unittests
170- # Skip testing distributed related unit tests since the memory of windows CI is limited
171- run : pytest tests/ --ignore tests/test_dist --ignore tests/test_optim/test_optimizer/test_optimizer_wrapper.py --ignore tests/test_model/test_wrappers/test_model_wrapper.py --ignore tests/test_hooks/test_sync_buffers_hook.py
172- if : ${{ matrix.platform == 'cu111' }} || ${{ matrix.platform == 'cu118' }}
101+ # build_windows:
102+ # runs-on: windows-2022
103+ # strategy:
104+ # matrix:
105+ # python-version: [3.9 ]
106+ # platform: [cpu, cu111]
107+ # torch: [1.8.1]
108+ # torchvision: [0.9.1]
109+ # include:
110+ # - python-version: 3.8
111+ # platform: cu118
112+ # torch: 2.1.0
113+ # torchvision: 0.16.0
114+ # steps:
115+ # - uses: actions/checkout@v3
116+ # - name: Set up Python ${{ matrix.python-version }}
117+ # uses: actions/setup-python@v4
118+ # with:
119+ # python-version: ${{ matrix.python-version }}
120+ # - name: Upgrade pip
121+ # # Windows CI could fail If we call `pip install pip --upgrade` directly.
122+ # run: python -m pip install pip wheel --upgrade
123+ # - name: Install PyTorch
124+ # run: pip install torch==${{matrix.torch}}+${{matrix.platform}} torchvision==${{matrix.torchvision}}+${{matrix.platform}} -f https://download.pytorch.org/whl/${{matrix.platform}}/torch_stable.html
125+ # - name: Build MMEngine from source
126+ # run: pip install -e . -v
127+ # - name: Install unit tests dependencies
128+ # run: |
129+ # pip install -r requirements/tests.txt
130+ # pip install openmim
131+ # mim install mmcv
132+ # - name: Run CPU unittests
133+ # run: pytest tests/ --ignore tests/test_dist
134+ # if: ${{ matrix.platform == 'cpu' }}
135+ # - name: Run GPU unittests
136+ # # Skip testing distributed related unit tests since the memory of windows CI is limited
137+ # run: pytest tests/ --ignore tests/test_dist --ignore tests/test_optim/test_optimizer/test_optimizer_wrapper.py --ignore tests/test_model/test_wrappers/test_model_wrapper.py --ignore tests/test_hooks/test_sync_buffers_hook.py
138+ # if: ${{ matrix.platform == 'cu111' }} || ${{ matrix.platform == 'cu118' }}
0 commit comments