-
Notifications
You must be signed in to change notification settings - Fork 195
82 lines (82 loc) · 3.47 KB
/
flake8.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
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
name: flake8
on:
pull_request:
branches: [ main, next ]
jobs:
compile:
name: compile libcamera
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: '3.9.19'
- name: Update
run: sudo apt update
- name: Install apt dependencies
run: sudo apt install -y build-essential qtbase5-dev libqt5core5a libqt5gui5 libqt5widgets5 libgnutls28-dev openssl libtiff5-dev libcap-dev libfmt-dev libdrm-dev git python3-sphinx libyaml-dev python3-yaml python3-ply python3-jinja2 libgnutls28-dev openssl libboost-dev
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Install dependencies for testing
run: |
if [ -f requirements-test.txt ]; then pip install -r requirements-test.txt; fi
- name: Set libcamera hash
run: echo "LIBCAMERA-HASH=$(git ls-remote https://github.com/raspberrypi/libcamera.git main | cut -c1-40)" >> $GITHUB_ENV
- name: Cache libcamera
id: cache-libcamera
uses: actions/cache@v3
with:
path: /home/runner/work/libcamera
key: ${{ runner.os }}-libcamera2-${{env.LIBCAMERA-HASH}}
- name: Generate libcamera
if: steps.cache-libcamera.outputs.cache-hit != 'true'
run: cd /home/runner/work; git clone https://github.com/raspberrypi/libcamera.git; cd libcamera; meson build --buildtype=release -Dpipelines=rpi/vc4 -Dipas=rpi/vc4 -Dv4l2=true -Dtest=false -Dlc-compliance=disabled -Dcam=disabled -Dqcam=disabled -Dpycamera=enabled -Ddocumentation=disabled ; ninja -C build
lint:
name: lint code
needs: compile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: '3.9.19'
- name: Display python version
run: python -c "import sys; print(sys.version)"
- name: Update
run: sudo apt update
- name: Install apt dependencies
run: sudo apt install -y build-essential libcap-dev libfmt-dev libdrm-dev git python3-sphinx libyaml-dev python3-yaml python3-ply python3-jinja2 libgnutls28-dev openssl libboost-dev
- name: Display python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Install dependencies for testing
run: |
if [ -f requirements-test.txt ]; then pip install -r requirements-test.txt; fi
- name: Set libcamera hash
run: echo "LIBCAMERA-HASH=$(git ls-remote https://github.com/raspberrypi/libcamera.git main | cut -c1-40)" >> $GITHUB_ENV
- name: Cache libcamera
id: cache-libcamera
uses: actions/cache@v3
with:
path: /home/runner/work/libcamera
key: ${{ runner.os }}-libcamera2-${{env.LIBCAMERA-HASH}}
- name: Generate libcamera
if: steps.cache-libcamera.outputs.cache-hit != 'true'
run: exit 1
- name: kmsxx
run: cd /home/runner/work; git clone https://github.com/tomba/kmsxx.git; cd kmsxx; meson build; ninja -C build
- name: set pythonpath
run: |
echo "PYTHONPATH=.:/home/runner/work/kmsxx/build/py/:/home/runner/work/libcamera/build/src/py/" >> $GITHUB_ENV
- name: test cv2
run: python -c 'import cv2; print(cv2.__version__)'
- name: test pykms
run: python -c 'import pykms'
- name: Lint with flake8
run: |
flake8 . --count --show-source --statistics