-
Notifications
You must be signed in to change notification settings - Fork 6
55 lines (51 loc) · 1.51 KB
/
test.yml
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
name: test
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
build:
strategy:
matrix:
include:
- opencv: 3
tools: true
- opencv: 4
- opencv: 4
tools: true
- tools: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.12"
- name: Install OpenCV
if: ${{ matrix.opencv }}
run: pip install opencv-python==${{ matrix.opencv }}.*
- name: Install Farmware Tools
if: ${{ matrix.tools }}
run: pip install farmware_tools
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install coveralls numpy
- name: NumPy version
run: python -c 'import numpy; print("NumPy " + numpy.__version__)'
- name: OpenCV version
if: ${{ matrix.opencv }}
run: python -c 'import cv2; print("OpenCV " + cv2.__version__)'
- name: Run tests
if: ${{ matrix.opencv }}
run: python -m coverage run --source . --omit=tests.py,config.py,config-3.py -m unittest discover -v
- name: Run tests without OpenCV
if: ${{ !matrix.opencv }}
run: python -m coverage run --source . --omit=tests.py,config.py,config-3.py -m unittest tests.TakePhotoTest.test_opencv_missing
- name: Upload coverage
run: coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}