|
1 | | -# This workflow will install Python dependencies, run tests and lint with a variety of Python versions |
2 | | -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions |
3 | | - |
4 | 1 | name: build |
5 | 2 |
|
6 | 3 | on: [push, pull_request] |
7 | 4 |
|
8 | 5 | jobs: |
9 | | - |
10 | 6 | lint: |
11 | 7 | runs-on: ubuntu-latest |
12 | 8 | steps: |
@@ -53,49 +49,49 @@ jobs: |
53 | 49 | python-version: 3.7 |
54 | 50 |
|
55 | 51 | steps: |
56 | | - - uses: actions/checkout@v2 |
57 | | - - name: Set up Python ${{ matrix.python-version }} |
58 | | - uses: actions/setup-python@v2 |
59 | | - with: |
60 | | - python-version: ${{ matrix.python-version }} |
61 | | - - name: Install CUDA |
62 | | - if: ${{matrix.torch == '1.5.0+cu101'}} |
63 | | - run: | |
64 | | - export INSTALLER=cuda-repo-${UBUNTU_VERSION}_${CUDA}_amd64.deb |
65 | | - wget http://developer.download.nvidia.com/compute/cuda/repos/${UBUNTU_VERSION}/x86_64/${INSTALLER} |
66 | | - sudo dpkg -i ${INSTALLER} |
67 | | - wget https://developer.download.nvidia.com/compute/cuda/repos/${UBUNTU_VERSION}/x86_64/7fa2af80.pub |
68 | | - sudo apt-key add 7fa2af80.pub |
69 | | - sudo apt update -qq |
70 | | - sudo apt install -y cuda-${CUDA_SHORT/./-} cuda-cufft-dev-${CUDA_SHORT/./-} |
71 | | - sudo apt clean |
72 | | - export CUDA_HOME=/usr/local/cuda-${CUDA_SHORT} |
73 | | - export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${CUDA_HOME}/include:${LD_LIBRARY_PATH} |
74 | | - export PATH=${CUDA_HOME}/bin:${PATH} |
75 | | - sudo apt-get install -y ninja-build |
76 | | - - name: Install Pillow |
77 | | - if: ${{matrix.torchvision == '0.4.2+cpu'}} |
78 | | - run: pip install Pillow==6.2.2 |
79 | | - - name: Install PyTorch |
80 | | - run: pip install torch==${{matrix.torch}} torchvision==${{matrix.torchvision}} -f https://download.pytorch.org/whl/torch_stable.html |
81 | | - - name: Install mmseg dependencies |
82 | | - run: | |
83 | | - pip install mmcv-full==latest+torch${{matrix.torch}} -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html |
84 | | - pip install -r requirements.txt |
85 | | - - name: Build and install |
86 | | - run: rm -rf .eggs && pip install -e . |
87 | | - - name: Run unittests and generate coverage report |
88 | | - run: | |
89 | | - coverage run --branch --source mmseg -m pytest tests/ |
90 | | - coverage xml |
91 | | - coverage report -m --omit="mmseg/utils/*","mmseg/apis/*" |
92 | | - # Only upload coverage report for python3.7 && pytorch1.5 |
93 | | - - name: Upload coverage to Codecov |
94 | | - if: ${{matrix.torch == '1.5.0+cu101' && matrix.python-version == '3.7'}} |
95 | | - |
96 | | - with: |
97 | | - file: ./coverage.xml |
98 | | - flags: unittests |
99 | | - env_vars: OS,PYTHON |
100 | | - name: codecov-umbrella |
101 | | - fail_ci_if_error: false |
| 52 | + - uses: actions/checkout@v2 |
| 53 | + - name: Set up Python ${{ matrix.python-version }} |
| 54 | + uses: actions/setup-python@v2 |
| 55 | + with: |
| 56 | + python-version: ${{ matrix.python-version }} |
| 57 | + - name: Install CUDA |
| 58 | + if: ${{matrix.torch == '1.5.0+cu101'}} |
| 59 | + run: | |
| 60 | + export INSTALLER=cuda-repo-${UBUNTU_VERSION}_${CUDA}_amd64.deb |
| 61 | + wget http://developer.download.nvidia.com/compute/cuda/repos/${UBUNTU_VERSION}/x86_64/${INSTALLER} |
| 62 | + sudo dpkg -i ${INSTALLER} |
| 63 | + wget https://developer.download.nvidia.com/compute/cuda/repos/${UBUNTU_VERSION}/x86_64/7fa2af80.pub |
| 64 | + sudo apt-key add 7fa2af80.pub |
| 65 | + sudo apt update -qq |
| 66 | + sudo apt install -y cuda-${CUDA_SHORT/./-} cuda-cufft-dev-${CUDA_SHORT/./-} |
| 67 | + sudo apt clean |
| 68 | + export CUDA_HOME=/usr/local/cuda-${CUDA_SHORT} |
| 69 | + export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${CUDA_HOME}/include:${LD_LIBRARY_PATH} |
| 70 | + export PATH=${CUDA_HOME}/bin:${PATH} |
| 71 | + sudo apt-get install -y ninja-build |
| 72 | + - name: Install Pillow |
| 73 | + if: ${{matrix.torchvision == '0.4.2+cpu'}} |
| 74 | + run: pip install Pillow==6.2.2 |
| 75 | + - name: Install PyTorch |
| 76 | + run: pip install torch==${{matrix.torch}} torchvision==${{matrix.torchvision}} -f https://download.pytorch.org/whl/torch_stable.html |
| 77 | + - name: Install mmseg dependencies |
| 78 | + run: | |
| 79 | + pip install mmcv-full==latest+torch${{matrix.torch}} -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html |
| 80 | + pip install -r requirements.txt |
| 81 | + - name: Build and install |
| 82 | + run: rm -rf .eggs && pip install -e . |
| 83 | + - name: Run unittests and generate coverage report |
| 84 | + run: | |
| 85 | + coverage run --branch --source mmseg -m pytest tests/ |
| 86 | + coverage xml |
| 87 | + coverage report -m |
| 88 | + # Only upload coverage report for python3.7 && pytorch1.5 |
| 89 | + - name: Upload coverage to Codecov |
| 90 | + if: ${{matrix.torch == '1.5.0+cu101' && matrix.python-version == '3.7'}} |
| 91 | + |
| 92 | + with: |
| 93 | + file: ./coverage.xml |
| 94 | + flags: unittests |
| 95 | + env_vars: OS,PYTHON |
| 96 | + name: codecov-umbrella |
| 97 | + fail_ci_if_error: false |
0 commit comments