mirror of
https://github.com/master-of-zen/Av1an.git
synced 2024-11-25 10:40:51 +00:00
7851d165b9
* Action:publish needs validate
212 lines
5.8 KiB
YAML
212 lines
5.8 KiB
YAML
name: tests
|
|
on:
|
|
push:
|
|
paths-ignore:
|
|
- "*.yml"
|
|
- .gitignore
|
|
- "*.md"
|
|
pull_request:
|
|
paths-ignore:
|
|
- "*.yml"
|
|
- .gitignore
|
|
- "*.md"
|
|
|
|
env:
|
|
deps: tree python-is-python3 python3-venv
|
|
DEBIAN_FRONTEND: noninteractive
|
|
|
|
jobs:
|
|
validate:
|
|
name: ${{ matrix.name }} ${{ matrix.enc }}
|
|
runs-on: ubuntu-latest
|
|
container: luigi311/encoders-docker:latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
enc: [aom, rav1e, svt_av1, vpx, x265, x264]
|
|
name: [baseline, target-quality]
|
|
include:
|
|
- name: baseline
|
|
flags: ""
|
|
- name: target-quality
|
|
flags: --target-quality 95
|
|
- name: chunk_hybrid
|
|
enc: aom
|
|
flags: --chunk-method hybrid
|
|
- name: chunk_select
|
|
enc: aom
|
|
flags: --chunk-method select
|
|
- name: chunk_ffms2
|
|
enc: aom
|
|
flags: --chunk-method vs_ffms2
|
|
- name: chunk_lsmash
|
|
enc: aom
|
|
flags: --chunk-method vs_lsmash
|
|
- name: scenes
|
|
enc: aom
|
|
flags: -s scenes.json
|
|
- name: workers
|
|
enc: aom
|
|
flags: -w 2
|
|
- name: vmaf
|
|
enc: aom
|
|
flags: --vmaf
|
|
- name: vmaf-plots
|
|
enc: aom
|
|
flags: --vmaf-plots
|
|
- name: extra_splits
|
|
enc: aom
|
|
flags: -x 10
|
|
- name: split_aom_keyframes
|
|
enc: aom
|
|
flags: --split-method aom_keyframes
|
|
- name: video_settings
|
|
enc: aom
|
|
flags: -v " --cpu-used=3 --end-usage=q --cq-level=30 --threads=8 "
|
|
- name: temp
|
|
enc: aom
|
|
flags: --temp temporary
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Validate encoders
|
|
run: |
|
|
aomenc --help
|
|
SvtAv1EncApp --help
|
|
rav1e --help
|
|
x265 --help || true
|
|
|
|
- name: Install rust
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: nightly
|
|
override: true
|
|
profile: default
|
|
default: true
|
|
components: rustfmt, clippy
|
|
|
|
- name: Run cargo check
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: check
|
|
|
|
- name: Install requirements
|
|
run: |
|
|
apt-get update && apt-get install -y ${{ env.deps }}
|
|
|
|
- uses: syphar/restore-virtualenv@v1
|
|
id: cache-virtualenv
|
|
with:
|
|
requirement_files: requirements.txt # this is optional
|
|
|
|
- uses: syphar/restore-pip-download-cache@v1
|
|
if: steps.cache-virtualenv.outputs.cache-hit != 'true'
|
|
|
|
# the package installation will only be executed when the
|
|
# requirements-files have changed.
|
|
- run: pip3 install -r requirements.txt
|
|
if: steps.cache-virtualenv.outputs.cache-hit != 'true'
|
|
|
|
- name: Build Av1an
|
|
run: |
|
|
pip3 install vapoursynth
|
|
maturin develop --release -m av1an-pyo3/Cargo.toml
|
|
|
|
- name: Download videos
|
|
run: |
|
|
for url in raw.githubusercontent.com/OpenVisualCloud/SVT-AV1-Resources/master randomderp.com; do
|
|
curl -LO https://$url/video.tar.gz && break
|
|
done
|
|
tar xf video.tar.gz
|
|
|
|
- name: Testing ${{ matrix.name }}
|
|
run: |
|
|
./av1an.py -i bus_cif.y4m -e ${{ matrix.enc }} -l log_av1an -t 20 --keep -o "bus_cif.mkv" ${{ matrix.flags }}
|
|
du -h bus_cif.mkv
|
|
tree -a
|
|
|
|
- name: Cat log
|
|
if: always()
|
|
run: cat log_av1an.log
|
|
|
|
docker:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
- name: Build
|
|
id: docker_build
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
push: false
|
|
tags: av1an:action
|
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
|
|
|
- name: Image digest
|
|
run: echo ${{ steps.docker_build.outputs.digest }}
|
|
|
|
- name: Tar docker cache
|
|
run: tar -cf /tmp/docker-cache.tar /tmp/.buildx-cache
|
|
|
|
- name: Artifact docker cache
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: docker-cache
|
|
path: /tmp/docker-cache.tar
|
|
|
|
docker-publish:
|
|
needs: [validate, docker]
|
|
runs-on: ubuntu-latest
|
|
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- uses: actions/download-artifact@v2
|
|
with:
|
|
name: docker-cache
|
|
path: /tmp/
|
|
|
|
- name: Extract docker cache
|
|
run: tar -xf /tmp/docker-cache.tar -C /
|
|
|
|
- name: Docker meta
|
|
id: docker_meta
|
|
uses: crazy-max/ghaction-docker-meta@v1
|
|
with:
|
|
images: ${{ secrets.DOCKERHUB_USERNAME }}/av1an # list of Docker images to use as base name for tags
|
|
tag-sha: true # add git short SHA as Docker tag
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
- name: Login to DockerHub
|
|
uses: docker/login-action@v1
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: Build and push
|
|
id: docker_build
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
push: true
|
|
tags: ${{ steps.docker_meta.outputs.tags }}
|
|
labels: ${{ steps.docker_meta.outputs.labels }}
|
|
cache-from: type=local,src=/tmp/.buildx-cache
|
|
|
|
- name: Image digest
|
|
run: echo ${{ steps.docker_build.outputs.digest }}
|