Skip to content

Commit 4cf7526

Browse files
bitraidMr-Dave
authored andcommitted
Add github CI workflow (#148)
Thanks.
1 parent c895686 commit 4cf7526

1 file changed

Lines changed: 104 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- .github/ISSUE_TEMPLATE/**
7+
- doc/**
8+
- man/**
9+
- '**/LICENCE'
10+
- '**/.gitignore'
11+
- '**.md'
12+
pull_request:
13+
paths-ignore:
14+
- .github/ISSUE_TEMPLATE/**
15+
- doc/**
16+
- man/**
17+
- '**/LICENCE'
18+
- '**/.gitignore'
19+
- '**.md'
20+
workflow_dispatch:
21+
22+
concurrency:
23+
group: ${{ github.workflow }}-${{ github.ref }}
24+
cancel-in-progress: true
25+
26+
jobs:
27+
build:
28+
runs-on: ubuntu-latest
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
cxx: [g++, clang++]
33+
libc: [glibc, musl]
34+
include:
35+
- cxx: g++
36+
cc: gcc
37+
- cxx: clang++
38+
cc: clang
39+
- libc: glibc
40+
shell: bash
41+
- libc: musl
42+
shell: alpine.sh {0}
43+
44+
defaults:
45+
run:
46+
shell: ${{ matrix.shell }}
47+
48+
steps:
49+
- name: Set up Ubuntu
50+
if: matrix.libc == 'glibc'
51+
run: |
52+
sudo apt-get update
53+
sudo apt-get install -y autopoint pkgconf gettext libcamera-dev libopencv-dev libavcodec-dev libavdevice-dev libavformat-dev libavutil-dev libswscale-dev libwebp-dev libmicrohttpd-dev libmariadb-dev libasound2-dev libpulse-dev libfftw3-dev
54+
55+
- name: Set up Alpine
56+
if: matrix.libc == 'musl'
57+
uses: jirutka/setup-alpine@master
58+
with:
59+
branch: edge
60+
packages: >
61+
build-base
62+
clang
63+
file
64+
autoconf
65+
automake
66+
gettext-dev
67+
libtool
68+
libzip-dev
69+
jpeg-dev
70+
v4l-utils-libs
71+
libcamera-dev
72+
opencv-dev
73+
ffmpeg-dev
74+
libmicrohttpd-dev
75+
sqlite-dev
76+
mariadb-dev
77+
alsa-lib-dev
78+
pulseaudio-dev
79+
fftw-dev
80+
81+
- name: Checkout source
82+
uses: actions/checkout@main
83+
84+
- name: Configure build
85+
run: |
86+
autoreconf -fiv
87+
./configure CC=${{ matrix.cc }} CXX=${{ matrix.cxx }}
88+
89+
- name: Build target
90+
run: |
91+
${{ matrix.CXX }} --version
92+
make -j $(($(nproc)+1))
93+
94+
- name: Run artifact
95+
run: |
96+
file ./src/motionplus
97+
./src/motionplus -h || true
98+
99+
- name: Upload artifact
100+
uses: actions/upload-artifact@main
101+
with:
102+
name: motionplus-${{ matrix.cc }}-${{ matrix.libc }}-${{ github.sha }}
103+
path: src/motionplus
104+
compression-level: 9

0 commit comments

Comments
 (0)