-
Notifications
You must be signed in to change notification settings - Fork 229
179 lines (135 loc) · 5.56 KB
/
rpicam-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
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
name: ToT libcamera build/run test
on:
schedule:
- cron: '02 01 * * *'
workflow_dispatch:
env:
# Customize the meson build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: release
GCC_COMPILER: "CC=/usr/bin/gcc CXX=/usr/bin/g++"
CLANG_COMPILER: "CC=/usr/bin/clang-13 CXX=/usr/bin/clang++-13"
LIBCAMERA_SRC_DIR: "${{github.workspace}}/../libcamera"
PICAMERA2_SRC_DIR: "${{github.workspace}}/../picamera2"
LIBCAMERA_INSTALL_DIR: "${{github.workspace}}/../libcamera/install"
LIBCAMERA_LKG_DIR: "/home/pi/libcamera_lkg"
LIBCAMERA_LD_LIBRARY_DIR: "${{github.workspace}}/../libcamera/install/lib/aarch64-linux-gnu"
jobs:
build-libcamera:
runs-on: [ self-hosted ]
steps:
- name: Clean libcamera
run: rm -rf ${{env.LIBCAMERA_SRC_DIR}}
- name: Pull libcamera
run: git clone --depth=1 https://github.com/raspberrypi/libcamera.git ${{env.LIBCAMERA_SRC_DIR}}
- name: libcamera version
run: cd ${{env.LIBCAMERA_SRC_DIR}} && git log -1
- name: Setup meson
run: cd ${{env.LIBCAMERA_SRC_DIR}} && meson setup build -Dprefix=${{env.LIBCAMERA_INSTALL_DIR}} -Dpipelines=rpi/vc4,rpi/pisp -Dipas=rpi/vc4,rpi/pisp -Dpycamera=enabled -Dtest=false -Dbuildtype=${{env.BUILD_TYPE}} -Dlibpisp:default_library=static
- name: Build
run: cd ${{env.LIBCAMERA_SRC_DIR}}/build && ninja install
timeout-minutes: 15
- name: Tar files
run: tar -cvf build-artifacts-libcamera.tar -C ${{env.LIBCAMERA_SRC_DIR}} .
- name: Upload build files
uses: actions/upload-artifact@v4
with:
name: build-artifacts-libcamera
path: build-artifacts-libcamera.tar
retention-days: 7
build-rpicam-apps:
runs-on: [ self-hosted ]
needs: build-libcamera
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
clean: true
- name: Clean libcamera
run: rm -rf ${{env.LIBCAMERA_SRC_DIR}} && mkdir -p ${{env.LIBCAMERA_SRC_DIR}}
- name: Download libcamera artifact
uses: actions/download-artifact@v4
with:
name: build-artifacts-libcamera
path: ${{github.workspace}}
- name: Untar libcamera files
run: tar -xvf build-artifacts-libcamera.tar -C ${{env.LIBCAMERA_SRC_DIR}}
- name: Configure meson
run: ${{env.GCC_COMPILER}} meson setup ${{github.workspace}}/build --pkg-config-path=${{env.LIBCAMERA_INSTALL_DIR}}/lib/aarch64-linux-gnu/pkgconfig/ -Dbuildtype=${{env.BUILD_TYPE}}
timeout-minutes: 5
- name: Build
run: ninja -C ${{github.workspace}}/build
timeout-minutes: 15
- name: Tar files
run: tar -cvf build-artifacts-rpicam-apps.tar -C ${{github.workspace}}/build .
- name: Upload build files
uses: actions/upload-artifact@v4
with:
name: build-artifacts-rpicam-apps
path: build-artifacts-rpicam-apps.tar
retention-days: 7
run-test:
runs-on: ${{matrix.camera}}
needs: build-rpicam-apps
strategy:
matrix:
camera: [ imx219, imx477, imx708, pi5-imx708-imx477 ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
clean: true
- name: Create test output dir
run: mkdir -p ${{github.workspace}}/test_output
- name: Download rpicam-apps build
uses: actions/download-artifact@v4
with:
name: build-artifacts-rpicam-apps
path: ${{github.workspace}}
- name: Untar rpicam-apps files
run: tar -xvf build-artifacts-rpicam-apps.tar --one-top-level=build
- name: Clean libcamera
run: rm -rf ${{env.LIBCAMERA_SRC_DIR}} && mkdir -p ${{env.LIBCAMERA_SRC_DIR}}
- name: Download libcamera artifact
uses: actions/download-artifact@v4
with:
name: build-artifacts-libcamera
path: ${{github.workspace}}
- name: Untar libcamera files
run: tar -xvf build-artifacts-libcamera.tar -C ${{env.LIBCAMERA_SRC_DIR}} --one-top-level=install
- name: Print version string
run: ${{github.workspace}}/build/apps/rpicam-hello --version
- name: Print linkage info
run: ldd ${{github.workspace}}/build/apps/rpicam-hello | grep libcamera
- name: Test rpicam-apps
run: ${{github.workspace}}/utils/test.py --exe-dir ${{github.workspace}}/build/apps/ --output-dir ${{github.workspace}}/test_output --json-dir ${{github.workspace}}/assets
timeout-minutes: 15
- name: Upload test output
if: ${{failure()}}
uses: actions/upload-artifact@v4
with:
name: test-artifacts-${{matrix.camera}}
path: ${{github.workspace}}/test_output/
retention-days: 7
update-rpicam-base:
runs-on: ${{matrix.camera}}
needs: run-test
strategy:
matrix:
camera: [ imx219, imx477, imx708, pi5-imx708-imx477 ]
steps:
- name: Clean libcamera LKG
run: rm -rf ${{env.LIBCAMERA_LKG_DIR}} && mkdir -p ${{env.LIBCAMERA_LKG_DIR}}
- name: Clean libcamera
run: rm -rf ${{env.LIBCAMERA_SRC_DIR}} && mkdir -p ${{env.LIBCAMERA_SRC_DIR}}
- name: Download libcamera artifact
uses: actions/download-artifact@v4
with:
name: build-artifacts-libcamera
path: ${{github.workspace}}
- name: Untar libcamera files
run: tar -xvf build-artifacts-libcamera.tar -C ${{env.LIBCAMERA_SRC_DIR}}
- name: Setup meson
run: cd ${{env.LIBCAMERA_SRC_DIR}} && meson setup build -Dprefix=${{env.LIBCAMERA_LKG_DIR}} -Dpipelines=rpi/vc4,rpi/pisp -Dipas=rpi/vc4,rpi/pisp -Dpycamera=enabled -Dtest=false -Dlibpisp:default_library=static --wipe
- name: Build
run: cd ${{env.LIBCAMERA_SRC_DIR}}/build && ninja install
timeout-minutes: 15