better ci?

This commit is contained in:
Robin Appelman 2021-07-03 23:13:07 +02:00
commit 15d51c65c1

View file

@ -4,7 +4,7 @@ on: [ push, pull_request ]
jobs: jobs:
build-linux: build-linux:
runs-on: ubuntu-latest runs-on: ubuntu-18.04
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1 - uses: actions-rs/toolchain@v1
@ -12,7 +12,7 @@ jobs:
profile: minimal profile: minimal
toolchain: stable toolchain: stable
override: true override: true
target: x86_64-unknown-linux-musl - uses: Swatinem/rust-cache@v1
# https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu # https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu
- name: Install FFmpegBuildTools - name: Install FFmpegBuildTools
@ -46,7 +46,16 @@ jobs:
sudo apt-get -y install libfdk-aac-dev sudo apt-get -y install libfdk-aac-dev
sudo apt-get -y install libmp3lame-dev sudo apt-get -y install libmp3lame-dev
sudo apt-get -y install libopus-dev sudo apt-get -y install libopus-dev
- run: |
- name: Cache ffmpeg
id: cache-ffmpeg
uses: actions/cache@v2
with:
path: ffmpeg_build
key: ${{ runner.os }}-ffmpeg
- name: Build ffmpeg
if: steps.cache-ffmpeg.outputs.cache-hit != 'true'
run: |
git clone https://github.com/ffmpeg/ffmpeg --depth 1 git clone https://github.com/ffmpeg/ffmpeg --depth 1
cd ffmpeg cd ffmpeg
mkdir build mkdir build
@ -60,11 +69,11 @@ jobs:
run: | run: |
FFMPEG_INCLUDE_DIR=${HOME}/ffmpeg_build/include \ FFMPEG_INCLUDE_DIR=${HOME}/ffmpeg_build/include \
FFMPEG_PKG_CONFIG_PATH=${HOME}/ffmpeg_build/lib/pkgconfig \ FFMPEG_PKG_CONFIG_PATH=${HOME}/ffmpeg_build/lib/pkgconfig \
cargo build --release --target x86_64-unknown-linux-musl cargo build --release
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2
with: with:
name: purpledot name: purpledot
path: target/x86_64-unknown-linux-musl/release/purpledot path: target/release/purpledot
build-windows: build-windows:
runs-on: windows-latest runs-on: windows-latest
steps: steps:
@ -74,6 +83,7 @@ jobs:
profile: minimal profile: minimal
toolchain: stable toolchain: stable
override: true override: true
- uses: Swatinem/rust-cache@v1
# Using this since it's used by clang-sys's CI # Using this since it's used by clang-sys's CI
- name: Install LLVM and Clang - name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1 uses: KyleMayes/install-llvm-action@v1
@ -81,12 +91,19 @@ jobs:
version: "10.0" version: "10.0"
directory: ${{ github.workspace }}/clang directory: ${{ github.workspace }}/clang
- name: Clone vcpkg FFmpeg - name: Cache vcpkg
run: git clone https://github.com/microsoft/vcpkg --depth 1 id: cache-vcpkg
- name: Bootstrap vcpkg FFmpeg uses: actions/cache@v2
run: ./vcpkg/bootstrap-vcpkg.bat with:
path: vcpkg
key: ${{ runner.os }}-vcpkg
- name: Vcpkg install ffmpeg - name: Vcpkg install ffmpeg
run: ./vcpkg/vcpkg.exe install ffmpeg:x64-windows-static if: steps.cache-vcpkg.outputs.cache-hit != 'true'
run: |
git clone https://github.com/microsoft/vcpkg --depth 1
./vcpkg/bootstrap-vcpkg.bat
./vcpkg/vcpkg.exe install ffmpeg:x64-windows-static
- name: Build - name: Build
env: env: