forked from carbotaniuman/libcamera_meme
-
Notifications
You must be signed in to change notification settings - Fork 12
93 lines (83 loc) · 3.13 KB
/
main.yml
File metadata and controls
93 lines (83 loc) · 3.13 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
name: Build driver
on:
push:
branches:
- 'master'
- 'releases/**'
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# From https://github.com/pguyot/arm-runner-action/blob/main/.github/workflows/test-cache.yml
- uses: actions/cache@v3
id: cache
with:
path: $RUNNER_TEMP/photon_libcam_builder.img
key: ${{ hashFiles('**/*.yml') }}
- uses: pguyot/arm-runner-action@HEAD
id: install_deps
if: steps.cache.outputs.cache-hit != 'true'
with:
# we don't want to optimize as it's two-stage
optimize_image: no
image_additional_mb: 1500
base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2023-12-11/2023-12-11-raspios-bookworm-arm64-lite.img.xz
commands: |
apt-get update
apt-get install -y libopencv-dev libegl1-mesa-dev libcamera-dev cmake build-essential libdrm-dev libgbm-dev default-jdk openjdk-17-jdk
- name: Move and rename image with dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
mv ${{ steps.install_deps.outputs.image }} $RUNNER_TEMP/photon_libcam_builder.img
- uses: pguyot/arm-runner-action@HEAD
with:
base_image: file://$RUNNER_TEMP/photon_libcam_builder.img
cpu: cortex-a7
image_additional_mb: 1500
bind_mount_repository: true
# Update again anyways to pull down the latest libcamera et al
commands: |
apt-get update
apt-get install -y libopencv-dev libegl1-mesa-dev libcamera-dev cmake build-essential libdrm-dev libgbm-dev default-jdk openjdk-17-jdk
cmake -B build-pi -DCMAKE_BUILD_TYPE=Release
cmake --build build-pi -- -j
- run: find .
- uses: actions/upload-artifact@master
with:
name: libcamera-driver
path: build-pi/*.so
- uses: actions/upload-artifact@master
with:
name: libcamera-meme
path: build-pi/libcamera_meme
# Push to dev release on pushes to master
- uses: pyTooling/Actions/releaser@r0
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: 'Dev'
rm: true
files: |
build-pi/*.so
if: github.event_name == 'push'
# Push to actual release, if tagged
- uses: softprops/action-gh-release@v1
with:
files: |
build-pi/*.so
if: startsWith(github.ref, 'refs/tags/v')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-chroot:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: |
sudo apt-get update && sudo apt-get install -y qemu qemu-user-static binfmt-support
docker run --mount type=bind,source=$(pwd),target=/opt/photon_sysroot/work mcm001/photon-libcamera-builder-entry:latest chroot /opt/photon_sysroot bash -c 'uname -a && cat /etc/os-release && cd /work && cmake -B build-pi -DCMAKE_BUILD_TYPE=Release && cmake --build build-pi -- -j'
- uses: actions/upload-artifact@master
with:
name: libcamera-driver-chroot
path: build-pi/*.so