Repository navigation
134 lines (110 loc) · 3.85 KB
/
Copy pathci.yml
File metadata and controls
134 lines (110 loc) · 3.85 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-15, windows-latest]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
opencv-version: ["4", "5"]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
- name: Install libegl (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y libegl1 libgl1
- name: Install package
run: |
pip install .[dev,tool]
pip install "opencv-python==${{ matrix.opencv-version }}.*" "opencv-contrib-python==${{ matrix.opencv-version }}.*"
cd packages/mvtb-data && pip install .
- name: Install open3d (one leg per supported Python version)
if: matrix.os == 'ubuntu-latest' && matrix.opencv-version == '5'
run: pip install open3d
- name: Install ros extra (rosbags, roslibpy, websockets)
if: matrix.os == 'ubuntu-latest' && matrix.opencv-version == '5'
run: pip install .[ros]
- name: Run tests
env:
MPLBACKEND: Agg
run: python -m pytest --timeout=50 --timeout-method=thread
pgraph-compat:
# BundleAdjust is the only pgraph user and pgraph 1.0 changed API (keyword-only
# graph constructors, UVertex -> Vertex, edges() a list). The main matrix
# installs whatever pip resolves, so run the pgraph-touching tests against
# both the 0.6 series and the newest release explicitly.
name: pgraph compat (${{ matrix.pgraph }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
pgraph: ["pgraph-python<1", "pgraph-python"]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.12"
- name: Install libegl
run: sudo apt-get update && sudo apt-get install -y libegl1 libgl1
- name: Install package
run: |
pip install .[dev,tool]
cd packages/mvtb-data && pip install .
- name: Install requested pgraph
run: |
pip install --upgrade "${{ matrix.pgraph }}"
pip show pgraph-python | grep -i '^version'
- name: Run pgraph tests
env:
MPLBACKEND: Agg
run: python -m pytest tests/test_bundleadjust.py --timeout=50 --timeout-method=thread
all-tests-passed:
name: All tests passed
needs: [test, pgraph-compat]
runs-on: ubuntu-latest
if: always()
steps:
- name: Check test matrix result
run: |
if [ "${{ needs.test.result }}" != "success" ]; then
echo "test matrix did not succeed: ${{ needs.test.result }}"
exit 1
fi
if [ "${{ needs.pgraph-compat.result }}" != "success" ]; then
echo "pgraph compat did not succeed: ${{ needs.pgraph-compat.result }}"
exit 1
fi
codecov:
needs: test
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.13"
- name: Install libegl
run: sudo apt-get update && sudo apt-get install -y libegl1 libgl1
- name: Install package
run: |
pip install .[dev,tool]
cd packages/mvtb-data && pip install .
- name: Run coverage
env:
MPLBACKEND: Agg
run: |
coverage run --source=machinevisiontoolbox --omit="src/machinevisiontoolbox/blocks/*,src/machinevision/blocks/*" -m pytest --timeout=50
coverage xml
- name: Upload to Codecov
uses: codecov/codecov-action@v7
with:
file: ./coverage.xml