@@ -21,20 +21,63 @@ jobs:
21
21
strategy :
22
22
matrix :
23
23
os : [ubuntu-latest, windows-latest, macos-latest]
24
+ # Unfortunately the CMake test target is OS dependent so we set it as
25
+ # a variable here.
26
+ include :
27
+ - os : ubuntu-latest
28
+ OTIO_TEST_TARGET : test
29
+ - os : windows-latest
30
+ OTIO_TEST_TARGET : RUN_TESTS
31
+ - os : macos-latest
32
+ OTIO_TEST_TARGET : test
33
+
34
+ env :
35
+ OTIO_BUILD_CONFIG : Release
36
+ OTIO_BUILD_DIR : ${{ github.workspace }}/build
37
+ OTIO_INSTALL_DIR : ${{ github.workspace }}/install
24
38
25
39
steps :
26
- - uses : actions/checkout@v2.3.5
40
+ - uses : actions/checkout@v3
27
41
with :
28
42
submodules : ' recursive'
29
-
30
- - name : compile c++
43
+ - name : Install coverage dependency
44
+ if : matrix.os == env.GH_COV_OS && github.actor != env.GH_DEPENDABOT
45
+ run : |
46
+ sudo apt-get install lcov
47
+ - name : Build
48
+ run : |
49
+ cmake -E make_directory ${{ env.OTIO_BUILD_DIR }}
50
+ cd ${{ env.OTIO_BUILD_DIR }}
51
+ cmake ${{ github.workspace }} -DCMAKE_INSTALL_PREFIX=${{ env.OTIO_INSTALL_DIR }} -DOTIO_SHARED_LIBS=OFF -DOTIO_CXX_COVERAGE=ON
52
+ cmake --build . --config ${{ env.OTIO_BUILD_CONFIG }}
53
+ - name : Run tests
54
+ run : |
55
+ cd ${{ env.OTIO_BUILD_DIR }}
56
+ cmake --build . --target ${{ matrix.OTIO_TEST_TARGET }} --config ${{ env.OTIO_BUILD_CONFIG }}
57
+ - name : Collect code coverage
58
+ if : matrix.os == env.GH_COV_OS && github.actor != env.GH_DEPENDABOT
31
59
run : |
32
- mkdir build
33
- mkdir test_otio_inst_dir
34
- cd build
35
- cmake .. -DCMAKE_INSTALL_PREFIX=test_otio_inst_dir
36
- cmake --build . --target install --config release
37
-
60
+ cd ${{ env.OTIO_BUILD_DIR }}
61
+ lcov --capture -b . --directory . --output-file=coverage.info -q
62
+ cat coverage.info | sed "s/SF:.*src/SF:src/g" > coverage.filtered.info
63
+ lcov --remove coverage.filtered.info '*/usr/*' --output-file=coverage.filtered.info -q
64
+ lcov --remove coverage.filtered.info '*/deps/*' --output-file=coverage.filtered.info -q
65
+ lcov --remove coverage.filtered.info '*/tests/*' --output-file=coverage.filtered.info -q
66
+ lcov --list coverage.filtered.info
67
+ # \todo Should the Codecov web pages show the results of the C++ or Python tests?
68
+ # - name: Upload coverage to Codecov
69
+ # if: matrix.os == env.GH_COV_OS && github.actor != env.GH_DEPENDABOT
70
+
71
+ # with:
72
+ # files: ${{ env.OTIO_BUILD_DIR }}/coverage.filtered.info
73
+ # flags: unittests
74
+ # name: opentimelineio-codecov
75
+ # fail_ci_if_error: true
76
+ - name : Install
77
+ run : |
78
+ cd ${{ env.OTIO_BUILD_DIR }}
79
+ cmake --build . --target install --config ${{ env.OTIO_BUILD_CONFIG }}
80
+
38
81
py_build_test :
39
82
runs-on : ${{ matrix.os }}
40
83
strategy :
@@ -47,11 +90,11 @@ jobs:
47
90
OTIO_CXX_BUILD_TMP_DIR : ${{ github.workspace }}/build
48
91
49
92
steps :
50
- - uses : actions/checkout@v2.3.5
93
+ - uses : actions/checkout@v3
51
94
with :
52
95
submodules : ' recursive'
53
96
- name : Set up Python ${{ matrix.python-version }}
54
- uses : actions/setup-python@v2.2.2
97
+ uses : actions/setup-python@v3
55
98
with :
56
99
python-version : ${{ matrix.python-version }}
57
100
- name : Install coverage dependency
80
123
if : matrix.python-version == env.GH_COV_PY && matrix.os == env.GH_COV_OS && github.actor != env.GH_DEPENDABOT
81
124
82
125
with :
83
- flags : unittests
84
- name : opentimelineio-codecov
126
+ flags : py- unittests
127
+ name : py- opentimelineio-codecov
85
128
fail_ci_if_error : true
86
129
87
130
package_wheels :
92
135
os : [ubuntu-latest, windows-latest, macos-latest]
93
136
python-build : [cp27*, cp37*, cp38*, cp39*]
94
137
steps :
95
- - uses : actions/checkout@v2.3.5
138
+ - uses : actions/checkout@v3
96
139
97
140
# cibuildwheel 1.12.0 gates Python 2.7 wheels builds
98
141
# by using two environment variables, DISTUTILS_USE_SDK and MSSdk.
@@ -126,11 +169,11 @@ jobs:
126
169
needs : py_build_test
127
170
runs-on : ubuntu-latest
128
171
steps :
129
- - uses : actions/checkout@v2.3.5
172
+ - uses : actions/checkout@v3
130
173
with :
131
174
submodules : ' recursive'
132
175
133
- - uses : actions/setup-python@v2
176
+ - uses : actions/setup-python@v3
134
177
135
178
- name : Install pypa/build
136
179
run : python -m pip install build --user
0 commit comments