Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create build.yml #1

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
146 changes: 146 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
name: C/C++ CI
env:
ffmpeg-ref: n4.3.1
phpcpp-ref: da21e3a0bc5afdfeea1cbfe44b16472fc69e135b

on:
push:
branches: [ gh-actions ]

jobs:
build-ffmpeg:
runs-on: ubuntu-latest
env:
ffmpeg-build-params: >
--prefix=./build
--enable-shared
--disable-programs
--enable-libmp3lame
--disable-doc
--disable-network
--disable-swscale
--disable-libxcb
--disable-libxcb-shm
--disable-libxcb-xfixes
--disable-libxcb-shape
--enable-protocol=file
--disable-filters --enable-filter=anull --enable-filter=anullsink --enable-filter=anullsrc
--disable-decoders --enable-decoder=aac --enable-decoder=aac_at --enable-decoder=aac_fixed --enable-decoder=aac_latm --enable-decoder=opus --enable-decoder=aasc --enable-decoder=ac3 --enable-decoder=ac3_at --enable-decoder=cllc --enable-decoder=pam --enable-decoder=ac3_fixed --enable-decoder=pcm_alaw --enable-decoder=adpcm_4xm --enable-decoder=pcm_alaw_at --enable-decoder=adpcm_adx --enable-decoder=pcm_bluray --enable-decoder=adpcm_afc --enable-decoder=pcm_dvd --enable-decoder=adpcm_agm --enable-decoder=pcm_f16le --enable-decoder=adpcm_aica --enable-decoder=pcm_f24le --enable-decoder=text --enable-decoder=adpcm_argo --enable-decoder=derf_dpcm --enable-decoder=pcm_f32be --enable-decoder=adpcm_ct --enable-decoder=pcm_f32le --enable-decoder=adpcm_dtk --enable-decoder=pcm_f64be --enable-decoder=adpcm_ea --enable-decoder=pcm_f64le --enable-decoder=dolby_e --enable-decoder=pcm_lxf --enable-decoder=adpcm_ea_r1 --enable-decoder=pcm_mulaw --enable-decoder=truehd --enable-decoder=adpcm_ea_r2 --enable-decoder=dsd_lsbf --enable-decoder=pcm_mulaw_at --enable-decoder=adpcm_ea_r3 --enable-decoder=libfdk_aac --enable-decoder=pcm_s16be --enable-decoder=adpcm_ea_xas --enable-decoder=libgsm --enable-decoder=pcm_s16be_planar --enable-decoder=adpcm_g722 --enable-decoder=pcm_s16le --enable-decoder=adpcm_g726 --enable-decoder=pcm_s16le_planar --enable-decoder=adpcm_g726le --enable-decoder=pcm_s24be --enable-decoder=pcm_s24daud --enable-decoder=adpcm_ima_amv --enable-decoder=libopenh264 --enable-decoder=pcm_s24le --enable-decoder=adpcm_ima_apc --enable-decoder=pcm_s24le_planar --enable-decoder=adpcm_ima_apm --enable-decoder=dvbsub --enable-decoder=libopus --enable-decoder=pcm_s32be --enable-decoder=adpcm_ima_cunning --enable-decoder=pcm_s32le --enable-decoder=adpcm_ima_dat4 --enable-decoder=pcm_s32le_planar --enable-decoder=adpcm_ima_dk3 --enable-decoder=libvorbis --enable-decoder=pcm_s64be --enable-decoder=adpcm_ima_dk4 --enable-decoder=pcm_s64le --enable-decoder=adpcm_ima_ea_eacs --enable-decoder=pcm_s8 --enable-decoder=adpcm_ima_ea_sead --enable-decoder=eac3 --enable-decoder=pcm_s8_planar --enable-decoder=adpcm_ima_iss --enable-decoder=eac3_at --enable-decoder=pcm_u16be --enable-decoder=adpcm_ima_moflex --enable-decoder=pcm_u16le --enable-decoder=adpcm_ima_mtf --enable-decoder=pcm_u24be --enable-decoder=adpcm_ima_oki --enable-decoder=pcm_u24le --enable-decoder=adpcm_ima_qt --enable-decoder=pcm_u32be --enable-decoder=pcm_u32le --enable-decoder=pcm_u8 --enable-decoder=adpcm_ima_smjpeg --enable-decoder=pcm_vidc --enable-decoder=vorbis --enable-decoder=ffv1 --enable-decoder=flac --enable-decoder=mp1 --enable-decoder=mp1_at --enable-decoder=mp1float --enable-decoder=flic --enable-decoder=mp2 --enable-decoder=flv --enable-decoder=mp2_at --enable-decoder=mp2float --enable-decoder=mp3 --enable-decoder=mp3_at --enable-decoder=mp3adu --enable-decoder=mp3adufloat --enable-decoder=mp3float --enable-decoder=mp3on4 --enable-decoder=mp3on4float --enable-decoder=mpeg1_v4l2m2m --enable-decoder=wavpack --enable-decoder=webp --enable-decoder=mpeg2_mediacodec --enable-decoder=mpeg2_v4l2m2m --enable-decoder=mpeg4 --enable-decoder=mpeg4_crystalhd --enable-decoder=mpeg4_cuvid --enable-decoder=mpeg4_mediacodec --enable-decoder=mpeg4_mmal --enable-decoder=mpeg4_v4l2m2m --enable-decoder=msmpeg4_crystalhd --enable-decoder=msmpeg4v3
--disable-encoders --enable-encoder=aac --enable-encoder=ac3 --enable-encoder=mp3_mf --enable-encoder=mpeg4 --enable-encoder=libmp3lame --enable-encoder=pcm_alaw --enable-encoder=pcm_alaw_at --enable-encoder=pcm_dvd --enable-encoder=pcm_f32be --enable-encoder=pcm_f32le --enable-encoder=pcm_f64be --enable-encoder=pcm_f64le --enable-encoder=pcm_mulaw --enable-encoder=pcm_mulaw_at --enable-encoder=pcm_s16be --enable-encoder=pcm_s16be_planar --enable-encoder=pcm_s16le --enable-encoder=pcm_s16le_planar --enable-encoder=pcm_s24be --enable-encoder=pcm_s24daud --enable-encoder=pcm_s24le --enable-encoder=pcm_s24le_planar --enable-encoder=pcm_s32be --enable-encoder=pcm_s32le --enable-encoder=pcm_s32le_planar --enable-encoder=pcm_s64be --enable-encoder=pcm_s64le --enable-encoder=pcm_s8 --enable-encoder=pcm_s8_planar --enable-encoder=pcm_u16be --enable-encoder=pcm_u16le --enable-encoder=pcm_u24be --enable-encoder=pcm_u24le --enable-encoder=pcm_u32be --enable-encoder=pcm_u32le --enable-encoder=pcm_u8 --enable-encoder=pcm_vid
--disable-muxers --enable-muxer=ac3 --enable-muxer=mp2 --enable-muxer=mp3 --enable-muxer=mp4 --enable-muxer=matroska_audio --enable-muxer=wav --enable-muxer=webm --enable-muxer=webp --enable-muxer=pcm_alaw --enable-muxer=pcm_f32be --enable-muxer=pcm_f32le --enable-muxer=pcm_f64be --enable-muxer=pcm_f64le --enable-muxer=pcm_mulaw --enable-muxer=pcm_s16be --enable-muxer=pcm_s16le --enable-muxer=pcm_s24be --enable-muxer=pcm_s24le --enable-muxer=pcm_s32be --enable-muxer=pcm_s32le --enable-muxer=pcm_s8 --enable-muxer=pcm_u16be --enable-muxer=pcm_u16le --enable-muxer=pcm_u24be --enable-muxer=pcm_u24le --enable-muxer=pcm_u32be --enable-muxer=pcm_u32le --enable-muxer=pcm_u8 --enable-muxer=pcm_vidc
--disable-demuxers --enable-demuxer=aa --enable-demuxer=aac --enable-demuxer=ac3 --enable-demuxer=acm --enable-demuxer=act --enable-demuxer=ogg --enable-demuxer=pcm_f32be --enable-demuxer=pcm_f32le --enable-demuxer=flac --enable-demuxer=pcm_f64be --enable-demuxer=flic --enable-demuxer=pcm_f64le --enable-demuxer=flv --enable-demuxer=pcm_mulaw --enable-demuxer=pcm_s16be --enable-demuxer=pcm_s16le --enable-demuxer=pcm_s24be --enable-demuxer=pcm_s24le --enable-demuxer=pcm_s32be --enable-demuxer=pcm_s32le --enable-demuxer=pcm_s8 --enable-demuxer=pcm_u16be --enable-demuxer=pcm_u16le --enable-demuxer=pcm_u24be --enable-demuxer=pcm_u24le --enable-demuxer=pcm_u32be --enable-demuxer=av1 --enable-demuxer=pcm_u32le --enable-demuxer=avi --enable-demuxer=pcm_u8 --enable-demuxer=avisynth --enable-demuxer=h261 --enable-demuxer=pcm_vidc --enable-demuxer=h263 --enable-demuxer=m4v --enable-demuxer=h264 --enable-demuxer=matroska --enable-demuxer=mcc --enable-demuxer=mjpeg --enable-demuxer=mjpeg_2000 --enable-demuxer=wav --enable-demuxer=mov --enable-demuxer=mp3 --enable-demuxer=mpegps --enable-demuxer=mpegts --enable-demuxer=mpegtsraw --enable-demuxer=mpegvideo --enable-demuxer=data
--disable-protocols --enable-protocol=file --enable-protocol=subfile
--logfile=configure.log

steps:
- name: Computed cache key
id: cache-key
run: echo "::set-output name=cache-key::$(echo -n "${{ env.ffmpeg-build-params }}" | md5sum | awk '{print $1}')"

- name: Cache ffmpeg build output
id: cache
uses: actions/cache@v2
with:
path: ./build
key: ${{ runner.os }}-build-ffmpeg-${{ env.ffmpeg-ref }}-${{ steps.cache-key.outputs.cache-key }}

- uses: actions/checkout@v2
if: steps.cache.outputs.cache-hit != 'true'
with:
repository: FFmpeg/FFmpeg
ref: ${{ env.ffmpeg-ref }}

- name: install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: sudo apt-get -y install build-essential autoconf automake cmake libtool nasm pkg-config libmp3lame-dev

- name: configure
if: steps.cache.outputs.cache-hit != 'true'
run: ./configure ${{ env.ffmpeg-build-params }}

- name: make
if: steps.cache.outputs.cache-hit != 'true'
run: make && make install

- uses: actions/upload-artifact@v2
with:
name: ffmpeg-lib-binaries
path: |
./build/lib/*.so
./build/lib/pkgconfig

build-php-cpp:
runs-on: ubuntu-latest
steps:
- name: Cache phpcpp build output
id: cache
uses: actions/cache@v2
with:
path: ./build
key: ${{ runner.os }}-build-phpcpp-${{ env.phpcpp-ref }}-debug

- name: debug
run: ls -al . build || echo 1

- uses: actions/checkout@v2
if: steps.cache.outputs.cache-hit != 'true'
with:
repository: CopernicaMarketingSoftware/PHP-CPP
ref: ${{ env.phpcpp-ref }}

- name: install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: sudo apt-get -y install build-essential autoconf automake cmake libtool

- name: make
if: steps.cache.outputs.cache-hit != 'true'
run: make

- name: stage lib
if: steps.cache.outputs.cache-hit != 'true'
run: mkdir -p build && mv *.so.* build/

- name: debug
run: ls -al . build

- uses: actions/upload-artifact@v2
with:
name: phpcpp-lib
path: ./build/*.so.*


build:
needs: [build-ffmpeg, build-php-cpp]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/checkout@v2
with:
repository: CopernicaMarketingSoftware/PHP-CPP
ref: ${{ env.phpcpp-ref }}
path: php-cpplib

- name: debug
run: ls -al php-cpplib

- uses: actions/download-artifact@v2
with:
name: phpcpp-lib
path: php-cpplib

- uses: actions/download-artifact@v2
with:
name: ffmpeg-lib-binaries
path: ffmpeg

- name: debug
run: ls -al php-cpplib ffmpeg .

- name: make
run: cd libhomeaudio && make