forked from open-mmlab/mmagic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request open-mmlab#109 from hellock/fix-version
Fix setup and CI
- Loading branch information
Showing
5 changed files
with
60 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,25 +3,50 @@ name: build | |
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.7 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.7 | ||
- name: Install linting dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install flake8 isort==4.3.21 yapf interrogate | ||
- name: Lint with flake8 | ||
run: flake8 . | ||
- name: Lint with isort | ||
run: isort --recursive --check-only --diff mmedit/ tools/ tests/ demo/ | ||
- name: Format python codes with yapf | ||
run: yapf -r -d mmedit/ tools/ configs/ tests/ demo/ | ||
- name: Check docstring | ||
run: interrogate -v --ignore-init-method --ignore-module --ignore-nested-functions --ignore-regex "__repr__" --fail-under 80 mmedit | ||
|
||
build: | ||
env: | ||
CUDA: 10.1.105-1 | ||
CUDA_SHORT: 10.1 | ||
UBUNTU_VERSION: ubuntu1804 | ||
FORCE_CUDA: 1 | ||
MMCV_CUDA_ARGS: -gencode=arch=compute_61,code=sm_61 | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.6, 3.7] | ||
torch: [1.3.0, 1.5.0] | ||
torch: [1.3.0+cpu, 1.5.0+cpu] | ||
include: | ||
- torch: 1.3.0 | ||
torchvision: 0.4.2 | ||
cuda_arch: "6.0" | ||
- torch: 1.5.0 | ||
torchvision: 0.6.0 | ||
cuda_arch: "7.0" | ||
- torch: 1.3.0+cpu | ||
torchvision: 0.4.2+cpu | ||
- torch: 1.5.0+cpu | ||
torchvision: 0.6.0+cpu | ||
- torch: 1.5.0+cpu | ||
torchvision: 0.6.0+cpu | ||
python-version: 3.8 | ||
- torch: 1.5.0+cu101 | ||
torchvision: 0.6.0+cu101 | ||
python-version: 3.7 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
@@ -30,6 +55,7 @@ jobs: | |
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install CUDA | ||
if: ${{matrix.torch == '1.5.0+cu101'}} | ||
run: | | ||
export INSTALLER=cuda-repo-${UBUNTU_VERSION}_${CUDA}_amd64.deb | ||
wget http://developer.download.nvidia.com/compute/cuda/repos/${UBUNTU_VERSION}/x86_64/${INSTALLER} | ||
|
@@ -44,35 +70,24 @@ jobs: | |
export PATH=${CUDA_HOME}/bin:${PATH} | ||
sudo apt-get install -y ninja-build | ||
- name: Install Pillow | ||
if: ${{matrix.torchvision == '0.4.2+cpu'}} | ||
run: pip install Pillow==6.2.2 | ||
if: ${{matrix.torchvision < 0.5}} | ||
- name: Install PyTorch | ||
run: pip install torch==${{matrix.torch}} torchvision==${{matrix.torchvision}} | ||
run: pip install torch==${{matrix.torch}} torchvision==${{matrix.torchvision}} -f https://download.pytorch.org/whl/torch_stable.html | ||
- name: Install mmedit dependencies | ||
run: | | ||
pip install mmcv-full==latest+torch${{matrix.torch}}+cu101 -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html | ||
pip install mmcv-full==latest+torch${{matrix.torch}} -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html | ||
pip install -r requirements.txt | ||
- name: Lint with flake8 | ||
run: flake8 . | ||
- name: Lint with isort | ||
run: isort --recursive --check-only --diff mmedit/ tools/ tests/ | ||
- name: Format with yapf | ||
run: yapf -r -d mmedit/ tools/ configs/ tests/ | ||
- name: Check docstring | ||
run: interrogate -v --ignore-init-method --ignore-module --ignore-nested-functions --ignore-regex "__repr__" --fail-under 80 mmedit | ||
- name: Build and install | ||
env: | ||
CUDA_ARCH: ${{matrix.cuda_arch}} | ||
run: | | ||
rm -rf .eggs | ||
python setup.py check -m -s | ||
TORCH_CUDA_ARCH_LIST=${CUDA_ARCH} python setup.py build_ext --inplace | ||
run: rm -rf .eggs && pip install -e . | ||
- name: Run unittests and generate coverage report | ||
run: | | ||
coverage run --branch --source mmedit -m pytest tests/ | ||
coverage xml | ||
coverage report -m | ||
# Only upload coverage report for python3.7 && pytorch1.5 | ||
- name: Upload coverage to Codecov | ||
if: ${{matrix.torch == '1.5.0+cu101' && matrix.python-version == '3.7'}} | ||
uses: codecov/[email protected] | ||
with: | ||
file: ./coverage.xml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0.5.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
future>=0.18.2 | ||
lmdb | ||
mmcv-full>=1.0.0 | ||
scikit-image | ||
tensorboard>=2.2.2 | ||
yapf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,4 @@ flake8 | |
interrogate | ||
isort==4.3.21 | ||
pytest | ||
pytest-cov | ||
pytest-runner | ||
ubelt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters