From bcd0c89ebb082921cd09a74d9ae5c7f17bacaf58 Mon Sep 17 00:00:00 2001 From: MengzhangLI Date: Tue, 22 Feb 2022 21:06:57 +0800 Subject: [PATCH] [Enhancement] Add win-ci (#1296) * [Enhancement] Add win-ci * add timm in win unittest * remove mmflow with mmseg in win unittest * remove opencv-python in requirements * add opencv2 back * move opencv installation into build.yml --- .github/workflows/build.yml | 36 ++++++++++++++++++++++++++++++++++++ requirements/tests.txt | 1 - 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f9820b3fc..9eccc5c58 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -214,3 +214,39 @@ jobs: env_vars: OS,PYTHON name: codecov-umbrella fail_ci_if_error: false + + test_windows: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [windows-2022] + python: [3.8] + platform: [cpu, cu111] + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + - name: Upgrade pip + run: pip install pip --upgrade --user + - name: Install OpenCV + run: pip install opencv-python>=3 + - name: Install PyTorch + # As a complement to Linux CI, we test on PyTorch LTS version + run: pip install torch==1.8.2+${{ matrix.platform }} torchvision==0.9.2+${{ matrix.platform }} -f https://download.pytorch.org/whl/lts/1.8/torch_lts.html + - name: Install MMCV + run: | + pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cpu/torch1.8/index.html --only-binary mmcv-full + - name: Install unittest dependencies + run: pip install -r requirements/tests.txt -r requirements/optional.txt + - name: Build and install + run: pip install -e . + - name: Run unittests + run: | + python -m pip install timm + coverage run --branch --source mmseg -m pytest tests/ + - name: Generate coverage report + run: | + coverage xml + coverage report -m diff --git a/requirements/tests.txt b/requirements/tests.txt index 991fd711d..74fc76146 100644 --- a/requirements/tests.txt +++ b/requirements/tests.txt @@ -1,7 +1,6 @@ codecov flake8 interrogate -isort==4.3.21 pytest xdoctest>=0.10.0 yapf