Actions: Add dependency caching for Linux and wasm

This commit is contained in:
KatieFrogs 2021-10-23 10:48:06 +03:00
parent b0566887a4
commit 64b360b4d9
5 changed files with 140 additions and 5 deletions

View File

@ -27,14 +27,60 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libmpg123-dev libvorbis-dev libavformat-dev libavcodec-dev libavutil-dev libswresample-dev
sudo apt-get install -y libao-dev audacious-dev libjansson-dev yasm libopus-dev
sudo apt-get install -y libvorbis-dev libjansson-dev yasm libopus-dev
- name: Create build environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Cache celt
uses: actions/cache@v2
with:
path: |
${{runner.workspace}}/dependencies/celt-0061
${{runner.workspace}}/dependencies/celt-0110
${{runner.workspace}}/build/dependencies/celt-0061/libcelt/.libs
${{runner.workspace}}/build/dependencies/celt-0110/libcelt/.libs
key: linux-celt-${{ hashFiles('cmake/dependencies/celt.cmake') }}
- name: Cache ffmpeg
uses: actions/cache@v2
with:
path: |
${{runner.workspace}}/build/dependencies/ffmpeg/bin/usr/local/include
${{runner.workspace}}/build/dependencies/ffmpeg/bin/usr/local/lib
key: linux-ffmpeg-${{ hashFiles('cmake/dependencies/ffmpeg.cmake') }}
- name: Cache atrac9
uses: actions/cache@v2
with:
path: |
${{runner.workspace}}/build/dependencies/LibAtrac9/bin
key: linux-atrac9-${{ hashFiles('cmake/dependencies/atrac9.cmake') }}
- name: Cache g719
uses: actions/cache@v2
with:
path: |
${{runner.workspace}}/build/dependencies/libg719_decode/libg719_decode.a
key: linux-g719-${{ hashFiles('cmake/dependencies/g719.cmake') }}
- name: Cache mpg123
uses: actions/cache@v2
with:
path: |
${{runner.workspace}}/dependencies/mpg123
${{runner.workspace}}/build/dependencies/mpg123/src/libmpg123/.libs
key: linux-mpg123-${{ hashFiles('cmake/dependencies/mpg123.cmake') }}
- name: Cache speex
uses: actions/cache@v2
with:
path: |
${{runner.workspace}}/build/dependencies/speex/libspeex/.libs
key: linux-speex-${{ hashFiles('cmake/dependencies/speex.cmake') }}
- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system

View File

@ -31,6 +31,60 @@ jobs:
- name: Create build environment
run: cmake -E make_directory ${{runner.workspace}}/embuild
- name: Cache celt
uses: actions/cache@v2
with:
path: |
${{runner.workspace}}/dependencies/celt-0061
${{runner.workspace}}/dependencies/celt-0110
${{runner.workspace}}/embuild/dependencies/celt-0061/libcelt/.libs
${{runner.workspace}}/embuild/dependencies/celt-0110/libcelt/.libs
key: wasm-celt-${{ hashFiles('cmake/dependencies/celt.cmake') }}
- name: Cache ffmpeg
uses: actions/cache@v2
with:
path: |
${{runner.workspace}}/embuild/dependencies/ffmpeg/bin/usr/local/include
${{runner.workspace}}/embuild/dependencies/ffmpeg/bin/usr/local/lib
key: wasm-ffmpeg-${{ hashFiles('cmake/dependencies/ffmpeg.cmake') }}
- name: Cache atrac9
uses: actions/cache@v2
with:
path: |
${{runner.workspace}}/embuild/dependencies/LibAtrac9/bin
key: wasm-atrac9-${{ hashFiles('cmake/dependencies/atrac9.cmake') }}
- name: Cache g719
uses: actions/cache@v2
with:
path: |
${{runner.workspace}}/embuild/dependencies/libg719_decode/libg719_decode.a
key: wasm-g719-${{ hashFiles('cmake/dependencies/g719.cmake') }}
- name: Cache speex
uses: actions/cache@v2
with:
path: |
${{runner.workspace}}/embuild/dependencies/speex/libspeex/.libs
key: wasm-speex-${{ hashFiles('cmake/dependencies/speex.cmake') }}
- name: Cache ogg
uses: actions/cache@v2
with:
path: |
${{runner.workspace}}/embuild/dependencies/ogg/libogg.a
${{runner.workspace}}/embuild/dependencies/ogg/include
key: wasm-ogg-${{ hashFiles('cmake/dependencies/ogg.cmake') }}
- name: Cache vorbis
uses: actions/cache@v2
with:
path: |
${{runner.workspace}}/embuild/dependencies/vorbis/lib/*.a
key: wasm-vorbis-${{ hashFiles('cmake/dependencies/vorbis.cmake') }}
- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/embuild

View File

@ -6,11 +6,21 @@ if(NOT WIN32 AND USE_G719)
)
if(G719_PATH)
set(G719_LINK_PATH ${G719_BIN}/libg719_decode.a)
configure_file(
${VGM_SOURCE_DIR}/ext_libs/libg719_decode/CMakeLists.txt
${G719_PATH}/CMakeLists.txt
COPYONLY)
add_subdirectory(${G719_PATH} ${G719_BIN} EXCLUDE_FROM_ALL)
if(EXISTS ${G719_LINK_PATH})
add_library(g719_decode STATIC IMPORTED)
set_target_properties(g719_decode PROPERTIES
IMPORTED_LOCATION ${G719_LINK_PATH}
)
else()
add_subdirectory(${G719_PATH} ${G719_BIN} EXCLUDE_FROM_ALL)
endif()
endif()
endif()
if(NOT USE_G719)

View File

@ -14,7 +14,17 @@ if(NOT WIN32 AND USE_VORBIS)
)
if(OGG_PATH)
add_subdirectory(${OGG_PATH} ${OGG_BIN} EXCLUDE_FROM_ALL)
set(OGG_LINK_PATH ${OGG_BIN}/libogg.a)
if(EXISTS ${OGG_LINK_PATH} AND EXISTS ${OGG_BIN}/include)
add_library(ogg STATIC IMPORTED)
set_target_properties(ogg PROPERTIES
IMPORTED_LOCATION ${OGG_LINK_PATH}
)
else()
add_subdirectory(${OGG_PATH} ${OGG_BIN} EXCLUDE_FROM_ALL)
endif()
set(OGG_INCLUDE_DIR ${OGG_PATH}/include ${OGG_BIN}/include)
set(OGG_LIBRARY ogg)
endif()

View File

@ -14,7 +14,22 @@ if(NOT WIN32 AND USE_VORBIS)
)
if(VORBIS_PATH)
add_subdirectory(${VORBIS_PATH} ${VORBIS_BIN} EXCLUDE_FROM_ALL)
set(VORBIS_LINK_PATH ${VORBIS_BIN}/lib/libvorbis.a)
set(VORBISFILE_LINK_PATH ${VORBIS_BIN}/lib/libvorbisfile.a)
if(EXISTS ${VORBIS_LINK_PATH} AND EXISTS ${VORBISFILE_LINK_PATH})
add_library(vorbis STATIC IMPORTED)
set_target_properties(vorbis PROPERTIES
IMPORTED_LOCATION ${VORBIS_LINK_PATH}
)
add_library(vorbisfile STATIC IMPORTED)
set_target_properties(vorbisfile PROPERTIES
IMPORTED_LOCATION ${VORBISFILE_LINK_PATH}
)
else()
add_subdirectory(${VORBIS_PATH} ${VORBIS_BIN} EXCLUDE_FROM_ALL)
endif()
set(OGG_VORBIS_INCLUDE_DIR ${VORBIS_PATH}/include)
set(OGG_VORBIS_LIBRARY vorbis)