From 37da21fda9d63ef7851141b95bf5796f0fc56c50 Mon Sep 17 00:00:00 2001 From: Vlad Jerca Date: Thu, 9 May 2019 23:12:16 +0300 Subject: [PATCH] chore: configure travis --- .build/travis-ffmpeg-config.js | 14 ++++++++++++++ .travis.yml | 26 ++++++++++++++++++++++++++ FFMpegCore.Test/ffmpeg.config.json | 2 +- README.md | 5 +++-- 4 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 .build/travis-ffmpeg-config.js create mode 100644 .travis.yml diff --git a/.build/travis-ffmpeg-config.js b/.build/travis-ffmpeg-config.js new file mode 100644 index 0000000..bcfe8ea --- /dev/null +++ b/.build/travis-ffmpeg-config.js @@ -0,0 +1,14 @@ +const fs = require('fs'); +const path = require('path'); + +const CONFIG_PATH = path.resolve('./FFMpegCore.Test/ffmpeg.config.json'); + +console.log('--- Configuring ffmpeg binary path for:', process.env.TRAVIS_OS_NAME); + +let data = require(CONFIG_PATH); + +data.RootDirectory = process.env.TRAVIS_OS_NAME === 'linux' ? + '/usr/bin' : + '/usr/local/bin'; + +fs.writeFileSync(CONFIG_PATH, JSON.stringify(data, null, 4)); diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..a44cb8b --- /dev/null +++ b/.travis.yml @@ -0,0 +1,26 @@ +language: csharp +mono: none +dotnet: 2.1.300 +os: + - linux + - osx +dist: trusty +before_install: + - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo add-apt-repository -y ppa:mc3man/trusty-media; fi + - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get update; fi + - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -y ffmpeg libgdiplus; fi + - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update; fi + - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install ffmpeg mono-libgdiplus; fi + - ffmpeg -hwaccels +script: + - nvm install --lts + - nvm use --lts + - node ./.build/travis-ffmpeg-config.js + - dotnet restore + - dotnet build ./FFMpegCore/ + - dotnet test ./FFMpegCore.Test/ +branches: + only: + - master + - /fix\/.+/ + - /feature\/.+/ diff --git a/FFMpegCore.Test/ffmpeg.config.json b/FFMpegCore.Test/ffmpeg.config.json index 7d50e79..5b351c0 100644 --- a/FFMpegCore.Test/ffmpeg.config.json +++ b/FFMpegCore.Test/ffmpeg.config.json @@ -1,3 +1,3 @@ { - "RootDirectory": ".//FFMPEG//bin" + "RootDirectory": "./FFMPEG/bin" } \ No newline at end of file diff --git a/README.md b/README.md index 3648e9c..4faa420 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ -![FFMpeg Sharp](https://media.licdn.com/media/gcrc/dms/image/C5612AQFDCKxnyQ3tmw/article-cover_image-shrink_600_2000/0?e=1542844800&v=beta&t=ntfxKUaio7wjO2VFRL4o7gyoIPNKT95SPt94etMFuzw) -# FFMpegCore [![NuGet Badge](https://buildstats.info/nuget/FFMpegCore)](https://www.nuget.org/packages/FFMpegCore/) +# FFMpegCore +[![NuGet Badge](https://buildstats.info/nuget/FFMpegCore)](https://www.nuget.org/packages/FFMpegCore/) +[![Build Status](https://travis-ci.org/vladjerca/FFMpegCore.svg?branch=master)](https://travis-ci.org/vladjerca/FFMpegCore) ## Setup