From b2b42cbd956d35bda7bb27630a2da7bc152c3590 Mon Sep 17 00:00:00 2001 From: Kai Chen Date: Tue, 7 Jul 2020 13:14:24 +0800 Subject: [PATCH] Add macos building in github action (#387) * add macos in github action * fix a package name * minor fix * fix typo * ignore progressbar testing * ignore timer testing * fix pytest configs * try fix --- .github/workflows/build.yml | 43 ++++++++++++++++++++++++++++++++----- setup.cfg | 3 --- 2 files changed, 38 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fc6624a9d..ac8f15ffe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,13 +3,12 @@ name: build on: [push, pull_request] jobs: - lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Set up Python 3.7 - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: python-version: 3.7 - name: Install linting dependencies @@ -41,7 +40,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - name: Install system dependencies @@ -85,7 +84,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - name: Install CUDA @@ -142,7 +141,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - name: Install system dependencies @@ -161,3 +160,37 @@ jobs: coverage run --branch --source=mmcv -m pytest tests/ coverage xml coverage report -m + + build_macos: + runs-on: macos-latest + strategy: + matrix: + torch: [1.5.0, 1.3.0] + include: + - torch: 1.3.0 + torchvision: 0.4.2 + - torch: 1.5.0 + torchvision: 0.6.0 + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.7 + uses: actions/setup-python@v2 + with: + python-version: 3.7 + - name: Install system dependencies + run: brew install ffmpeg jpeg-turbo + - name: Install unittest dependencies + run: pip install pytest coverage lmdb PyTurboJPEG + - name: Build and install + run: | + rm -rf .eggs + CC=clang CXX=clang++ CFLAGS='-stdlib=libc++' pip install -e . + - name: Install Pillow + run: pip install Pillow==6.2.2 + if: ${{matrix.torchvision == '0.4.2'}} + - name: Install PyTorch + run: pip install torch==${{matrix.torch}} torchvision==${{matrix.torchvision}} -f https://download.pytorch.org/whl/torch_stable.html + - name: Run unittests + run: | + # The timing on macos VMs is not precise, so we skip the progressbar tests + pytest tests/ --ignore tests/test_progressbar.py --ignore tests/test_timer.py diff --git a/setup.cfg b/setup.cfg index 2b5c44f30..f5c546c55 100644 --- a/setup.cfg +++ b/setup.cfg @@ -4,9 +4,6 @@ universal=1 [aliases] test=pytest -[tool:pytest] -addopts=tests/ - [yapf] based_on_style = pep8 blank_line_before_nested_class_or_def = true