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
pull/388/head
Kai Chen 2020-07-07 13:14:24 +08:00 committed by GitHub
parent b18a33833e
commit b2b42cbd95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 38 additions and 8 deletions

View File

@ -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

View File

@ -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