Unverified Commit b2b42cbd authored by Kai Chen's avatar Kai Chen Committed by GitHub
Browse files

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
parent b18a3383
...@@ -3,13 +3,12 @@ name: build ...@@ -3,13 +3,12 @@ name: build
on: [push, pull_request] on: [push, pull_request]
jobs: jobs:
lint: lint:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up Python 3.7 - name: Set up Python 3.7
uses: actions/setup-python@v1 uses: actions/setup-python@v2
with: with:
python-version: 3.7 python-version: 3.7
- name: Install linting dependencies - name: Install linting dependencies
...@@ -41,7 +40,7 @@ jobs: ...@@ -41,7 +40,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1 uses: actions/setup-python@v2
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- name: Install system dependencies - name: Install system dependencies
...@@ -85,7 +84,7 @@ jobs: ...@@ -85,7 +84,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1 uses: actions/setup-python@v2
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- name: Install CUDA - name: Install CUDA
...@@ -142,7 +141,7 @@ jobs: ...@@ -142,7 +141,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1 uses: actions/setup-python@v2
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- name: Install system dependencies - name: Install system dependencies
...@@ -161,3 +160,37 @@ jobs: ...@@ -161,3 +160,37 @@ jobs:
coverage run --branch --source=mmcv -m pytest tests/ coverage run --branch --source=mmcv -m pytest tests/
coverage xml coverage xml
coverage report -m 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
...@@ -4,9 +4,6 @@ universal=1 ...@@ -4,9 +4,6 @@ universal=1
[aliases] [aliases]
test=pytest test=pytest
[tool:pytest]
addopts=tests/
[yapf] [yapf]
based_on_style = pep8 based_on_style = pep8
blank_line_before_nested_class_or_def = true blank_line_before_nested_class_or_def = true
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment