forked from AcademySoftwareFoundation/OpenTimelineIO
-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (85 loc) · 3.12 KB
/
python-package.yml
File metadata and controls
97 lines (85 loc) · 3.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: OpenTimelineIO
# for configuring which build will be a C++ coverage build / coverage report
env:
GH_COV_PY: 3.7
GH_COV_OS: ubuntu-latest
GH_DEPENDABOT: dependabot
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: [2.7, 3.7, 3.8]
env:
OTIO_CXX_COVERAGE_BUILD: ON
OTIO_CXX_BUILD_TMP_DIR: ${{ github.workspace }}/build
steps:
- uses: actions/checkout@v2.3.4
with:
submodules: 'recursive'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2.2.2
with:
python-version: ${{ matrix.python-version }}
- name: Install coverage dependency
if: matrix.python-version == env.GH_COV_PY && matrix.os == env.GH_COV_OS && github.actor != env.GH_DEPENDABOT
run: |
sudo apt-get install lcov
- name: Install python build dependencies
run: |
python -m pip install --upgrade pip setuptools wheel flake8>=3.5 check-manifest
- name: install mock for python 2.7 tests only
if: matrix.python-version == 2.7
run: python -m pip install --upgrade mock
- name: Run check-manifest and lint check
run: make ci-prebuild
- name: Build and Install
run: |
# compile and install into virtualenv/virtual machine (verbosely)
pip install .[dev] -v
- name: Run tests w/ python coverage
run: make ci-postbuild
# (only on ubuntu/pyhton3.7)
- name: Generate C++ coverage report
if: matrix.python-version == env.GH_COV_PY && matrix.os == env.GH_COV_OS && github.actor != env.GH_DEPENDABOT
run: make lcov
- name: Upload coverage to Codecov
if: matrix.python-version == env.GH_COV_PY && matrix.os == env.GH_COV_OS && github.actor != env.GH_DEPENDABOT
uses: codecov/codecov-action@v1
with:
flags: unittests
name: opentimelineio-codecov
fail_ci_if_error: true
package_wheels:
name: Package wheels on ${{ matrix.os }}
needs: build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]
python-build: [cp27*, cp37*, cp38*]
steps:
- uses: actions/checkout@v2
# Used to host cibuildwheel
- uses: actions/setup-python@v2
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==1.10.0
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
# TODO: Solve for the 32-bit errors in windows python 2.7:
# https://github.com/pybind/cmake_example/blob/master/.github/workflows/wheels.yml#L66
env:
CIBW_SKIP: cp27-win*
CIBW_BUILD: ${{ matrix.python-build }}
- uses: actions/upload-artifact@v2
with:
name: wheels
path: ./wheelhouse/*.whl