From 4cf75265d142bfeee72d0a43c31b3d9dbcf9d0dd Mon Sep 17 00:00:00 2001 From: bitraid Date: Sun, 5 May 2024 06:45:43 +0300 Subject: [PATCH] Add github CI workflow (#148) Thanks. --- .github/workflows/ci.yml | 104 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..e52437c6 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,104 @@ +name: CI + +on: + push: + paths-ignore: + - .github/ISSUE_TEMPLATE/** + - doc/** + - man/** + - '**/LICENCE' + - '**/.gitignore' + - '**.md' + pull_request: + paths-ignore: + - .github/ISSUE_TEMPLATE/** + - doc/** + - man/** + - '**/LICENCE' + - '**/.gitignore' + - '**.md' + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + cxx: [g++, clang++] + libc: [glibc, musl] + include: + - cxx: g++ + cc: gcc + - cxx: clang++ + cc: clang + - libc: glibc + shell: bash + - libc: musl + shell: alpine.sh {0} + + defaults: + run: + shell: ${{ matrix.shell }} + + steps: + - name: Set up Ubuntu + if: matrix.libc == 'glibc' + run: | + sudo apt-get update + 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 + + - name: Set up Alpine + if: matrix.libc == 'musl' + uses: jirutka/setup-alpine@master + with: + branch: edge + packages: > + build-base + clang + file + autoconf + automake + gettext-dev + libtool + libzip-dev + jpeg-dev + v4l-utils-libs + libcamera-dev + opencv-dev + ffmpeg-dev + libmicrohttpd-dev + sqlite-dev + mariadb-dev + alsa-lib-dev + pulseaudio-dev + fftw-dev + + - name: Checkout source + uses: actions/checkout@main + + - name: Configure build + run: | + autoreconf -fiv + ./configure CC=${{ matrix.cc }} CXX=${{ matrix.cxx }} + + - name: Build target + run: | + ${{ matrix.CXX }} --version + make -j $(($(nproc)+1)) + + - name: Run artifact + run: | + file ./src/motionplus + ./src/motionplus -h || true + + - name: Upload artifact + uses: actions/upload-artifact@main + with: + name: motionplus-${{ matrix.cc }}-${{ matrix.libc }}-${{ github.sha }} + path: src/motionplus + compression-level: 9