mirror of
https://github.com/lifegpc/pixiv_downloader.git
synced 2026-06-06 05:49:01 +08:00
232 lines
6.9 KiB
YAML
232 lines
6.9 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Check Out
|
|
uses: actions/checkout@v2
|
|
- name: Build
|
|
run: cargo build -vv
|
|
- name: Run tests
|
|
run: cargo test --verbose
|
|
build-exif:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check Out
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
submodules: true
|
|
- name: Get cache key
|
|
id: cache_key
|
|
run: |
|
|
cd scripts
|
|
python3 get_cache_key.py exiv2 || exit 1
|
|
- name: Cache
|
|
id: cache
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: clib/
|
|
key: ${{ runner.os }}-${{ steps.cache_key.outputs.cache_key }}
|
|
- name: Build thirdparty library
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
run: |
|
|
cp scripts/build_*.sh -v ./ || exit 1
|
|
./build_exiv2.sh || exit 1
|
|
- name: Build
|
|
run: |
|
|
export CMAKE_PREFIX_PATH=`pwd`/clib
|
|
cargo build --features exif -vv || exit 1
|
|
- name: Test
|
|
run: |
|
|
export CMAKE_PREFIX_PATH=`pwd`/clib
|
|
export "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/clib/lib"
|
|
cargo test --features exif --verbose -- --show-output || exit 1
|
|
build-ugoira:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check Out
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
submodules: true
|
|
- name: Get cache key
|
|
id: cache_key
|
|
run: |
|
|
cd scripts
|
|
python3 get_cache_key.py libzip x264 ffmpeg || exit 1
|
|
- name: Cache
|
|
id: cache
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: clib/
|
|
key: ${{ runner.os }}-${{ steps.cache_key.outputs.cache_key }}
|
|
- name: Setup NASM
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
uses: ilammy/setup-nasm@v1
|
|
- name: Build thirdparty library
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
run: |
|
|
export PKG_CONFIG_PATH=`pwd`/clib/lib/pkgconfig
|
|
cp scripts/build_*.sh -v ./ || exit 1
|
|
./build_libzip.sh || exit 1
|
|
./build_x264.sh || exit 1
|
|
./build_ffmpeg.sh || exit 1
|
|
- name: Build
|
|
run: |
|
|
export PKG_CONFIG_PATH=`pwd`/clib/lib/pkgconfig
|
|
export CMAKE_PREFIX_PATH=`pwd`/clib
|
|
export "LIBRARY_PATH=$LIBRARY_PATH:`pwd`/clib/lib"
|
|
export "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/clib/lib"
|
|
cargo build --features ugoira -vv || exit 1
|
|
- name: Test
|
|
run: |
|
|
export PKG_CONFIG_PATH=`pwd`/clib/lib/pkgconfig
|
|
export CMAKE_PREFIX_PATH=`pwd`/clib
|
|
export "LIBRARY_PATH=$LIBRARY_PATH:`pwd`/clib/lib"
|
|
export "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/clib/lib"
|
|
cargo test --features ugoira --verbose -- --show-output || exit 1
|
|
build-server:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check Out
|
|
uses: actions/checkout@v2
|
|
- name: Build
|
|
run: cargo build --features server,db_sqlite -vv
|
|
- name: Run tests
|
|
run: cargo test --features server,db_sqlite --verbose -- --show-output
|
|
build-db-all:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check Out
|
|
uses: actions/checkout@v2
|
|
- name: Build
|
|
run: cargo build --features db_all -vv
|
|
- name: Run tests
|
|
run: cargo test --features db_all --verbose -- --show-output
|
|
build-all:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check Out
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
submodules: true
|
|
- name: Get cache key
|
|
id: cache_key
|
|
run: |
|
|
cd scripts
|
|
python3 get_cache_key.py exiv2 libzip x264 ffmpeg || exit 1
|
|
- name: Cache
|
|
id: cache
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: clib/
|
|
key: ${{ runner.os }}-${{ steps.cache_key.outputs.cache_key }}
|
|
- name: Setup NASM
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
uses: ilammy/setup-nasm@v1
|
|
- name: Build thirdparty library
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
run: |
|
|
export PKG_CONFIG_PATH=`pwd`/clib/lib/pkgconfig
|
|
cp scripts/build_*.sh -v ./ || exit 1
|
|
./build_exiv2.sh || exit 1
|
|
./build_libzip.sh || exit 1
|
|
./build_x264.sh || exit 1
|
|
./build_ffmpeg.sh || exit 1
|
|
- name: Build
|
|
run: |
|
|
export PKG_CONFIG_PATH=`pwd`/clib/lib/pkgconfig
|
|
export CMAKE_PREFIX_PATH=`pwd`/clib
|
|
export "LIBRARY_PATH=$LIBRARY_PATH:`pwd`/clib/lib"
|
|
export "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/clib/lib"
|
|
cargo build --features all -vv || exit 1
|
|
- name: Test
|
|
run: |
|
|
export PKG_CONFIG_PATH=`pwd`/clib/lib/pkgconfig
|
|
export CMAKE_PREFIX_PATH=`pwd`/clib
|
|
export "LIBRARY_PATH=$LIBRARY_PATH:`pwd`/clib/lib"
|
|
export "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/clib/lib"
|
|
cargo test --features all --verbose -- --show-output || exit 1
|
|
build-win:
|
|
runs-on: windows-latest
|
|
defaults:
|
|
run:
|
|
shell: cmd
|
|
- name: Check Out
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
submodules: true
|
|
- name: Get Cache Key
|
|
id: cache_key
|
|
run: |
|
|
cd scripts
|
|
python get_cache_key.py --prefix=win zlib pkgconf exiv2 openssl || exit 1
|
|
- name: Cache
|
|
id: cache
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: clib/
|
|
key: win-${{ steps.cache_key.outputs.cache_key }}
|
|
- name: Install Ninja
|
|
run: |
|
|
python -m pip install --upgrade ninja
|
|
- name: Install Meson
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
run: |
|
|
python -m pip install --upgrade meson
|
|
- name: Setup CL
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
uses: ilammy/msvc-dev-cmd@v1
|
|
- name: Set up NASM
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
uses: ilammy/[email protected]
|
|
- name: Setup MSYS2
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
uses: msys2/setup-msys2@v2
|
|
with:
|
|
msystem: MINGW64
|
|
update: true
|
|
install: >-
|
|
base-devel
|
|
- name: Build zlib
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
run: |
|
|
COPY /Y scripts\build_win_zlib.bat || exit 1
|
|
CALL build_win_zlib.bat || exit 1
|
|
- name: Build pkgconf
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
run: |
|
|
COPY /Y scripts\build_win_pkgconf.bat || exit 1
|
|
CALL build_win_pkgconf.bat || exit 1
|
|
- name: Build exiv2
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
run: |
|
|
COPY /Y build_win_exiv2.bat || exit 1
|
|
CALL build_win_exiv2.bat || exit 1
|
|
- name: Build openssl
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
run: |
|
|
COPY /Y scripts\build_win_openssl.bat || exit 1
|
|
CALL build_win_openssl.bat || exit 1
|
|
- name: Build
|
|
run: |
|
|
SET PKG_CONFIG_PATH=%CD%\clib\lib\pkgconfig
|
|
SET CMAKE_PREFIX_PATH=%CD%\clib
|
|
SET PATH=%PATH%;%CD%\clib\bin
|
|
cargo build --features exif -vv || exit 1
|