Av1an/.github/workflows/tests.yml
Josh Holmer 56461c6b17
Add mergify config (#445)
* Add mergify config

This config includes the following rules:

- Automatically merge once a PR passes all tests and is approved.
- Automatically backport each PR from our main branch into our stable branch

* Merge all tests into one run

* Cleanup and speed up test suite

* Migrate to a docker image with dav1d

* Create CI profile with debug assertions enabled

* Use faster params for all encoders

Co-authored-by: Redzic <yusufredzic@gmail.com>
2021-12-15 17:58:00 -05:00

306 lines
12 KiB
YAML

name: tests
on:
push:
paths-ignore:
- "*.yml"
- .gitignore
- "*.md"
pull_request:
paths-ignore:
- "*.yml"
- .gitignore
- "*.md"
env:
DEBIAN_FRONTEND: noninteractive
jobs:
all-tests:
runs-on: ubuntu-latest
container: shssoichiro/av1an-ci:latest
steps:
- uses: actions/checkout@v2
- name: Validate encoders
run: |
which aomenc
which SvtAv1EncApp
which rav1e
which vpxenc
which x265
which x264
- name: Build Av1an
run: |
cargo build --profile ci
# 352x240 112 frames test video
- name: Download test video
run: |
curl -LO https://media.xiph.org/video/derf/y4m/tt_sif.y4m
- name: Testing unit tests
working-directory: ./av1an-core
run: |
cargo test --profile ci
# The baseline tests should not include the faster default params, because we want to also test that
# it works without params passed
- name: Testing baseline aom
run: |
target/ci/av1an -i tt_sif.y4m -e aom --pix-format yuv420p --sc-method fast -y -o "tt_sif.mkv"
du -h tt_sif.mkv
- name: Testing baseline rav1e
run: |
target/ci/av1an -i tt_sif.y4m -e rav1e --pix-format yuv420p --sc-method fast -y -o "tt_sif.mkv"
du -h tt_sif.mkv
- name: Testing baseline svt-av1
run: |
target/ci/av1an -i tt_sif.y4m -e svt-av1 --pix-format yuv420p --sc-method fast -y -o "tt_sif.mkv"
du -h tt_sif.mkv
- name: Testing baseline vpx
run: |
target/ci/av1an -i tt_sif.y4m -e vpx --pix-format yuv420p --sc-method fast -y -o "tt_sif.mkv"
du -h tt_sif.mkv
- name: Testing baseline x265
run: |
target/ci/av1an -i tt_sif.y4m -e x265 --pix-format yuv420p -c mkvmerge --sc-method fast -y -o "tt_sif.mkv"
du -h tt_sif.mkv
- name: Testing baseline x264
run: |
target/ci/av1an -i tt_sif.y4m -e x264 --pix-format yuv420p --sc-method fast -y -o "tt_sif.mkv"
du -h tt_sif.mkv
- name: Testing baseline-select aom
run: |
target/ci/av1an -i tt_sif.y4m -e aom --pix-format yuv420p --sc-method fast -y -o "tt_sif.mkv" -v " --cpu-used=10 --rt --threads=4" -p1 --chunk-method select
du -h tt_sif.mkv
- name: Testing baseline-select rav1e
run: |
target/ci/av1an -i tt_sif.y4m -e rav1e --pix-format yuv420p --sc-method fast -y -o "tt_sif.mkv" -v " --speed 10 --low-latency" --chunk-method select
du -h tt_sif.mkv
- name: Testing baseline-select svt-av1
run: |
target/ci/av1an -i tt_sif.y4m -e svt-av1 --pix-format yuv420p --sc-method fast -y -o "tt_sif.mkv" -v " --preset 8" --chunk-method select
du -h tt_sif.mkv
- name: Testing baseline-select vpx
run: |
target/ci/av1an -i tt_sif.y4m -e vpx --pix-format yuv420p --sc-method fast -y -o "tt_sif.mkv" -v " --cpu-used=9 --rt --threads=4" -p1 --chunk-method select
du -h tt_sif.mkv
- name: Testing baseline-select x265
run: |
target/ci/av1an -i tt_sif.y4m -e x265 --pix-format yuv420p -c mkvmerge --sc-method fast -y -o "tt_sif.mkv" -v " --preset ultrafast" --chunk-method select
du -h tt_sif.mkv
- name: Testing baseline-select x264
run: |
target/ci/av1an -i tt_sif.y4m -e x264 --pix-format yuv420p --sc-method fast -y -o "tt_sif.mkv" -v " --preset ultrafast" --chunk-method select
du -h tt_sif.mkv
# TODO: remove the --crf/--quantizer/--cq-level params once the bug of not specifying them resulting in a panic is fixed
- name: Testing target-quality aom
run: |
target/ci/av1an -i tt_sif.y4m -e aom --pix-format yuv420p --sc-method fast -y -o "tt_sif.mkv" -v " --cpu-used=10 --rt --threads=4 --cq-level=0" -p1 --target-quality 95
du -h tt_sif.mkv
- name: Testing target-quality rav1e
run: |
target/ci/av1an -i tt_sif.y4m -e rav1e --pix-format yuv420p --sc-method fast -y -o "tt_sif.mkv" -v " --speed 10 --low-latency --quantizer 0" --target-quality 95
du -h tt_sif.mkv
- name: Testing target-quality svt-av1
run: |
target/ci/av1an -i tt_sif.y4m -e svt-av1 --pix-format yuv420p --sc-method fast -y -o "tt_sif.mkv" -v " --preset 8 --crf 0" --target-quality 95
du -h tt_sif.mkv
- name: Testing target-quality vpx
run: |
target/ci/av1an -i tt_sif.y4m -e vpx --pix-format yuv420p --sc-method fast -y -o "tt_sif.mkv" -v " --cpu-used=9 --rt --threads=4 --cq-level=0" -p1 --target-quality 95
du -h tt_sif.mkv
- name: Testing target-quality x265
run: |
target/ci/av1an -i tt_sif.y4m -e x265 --pix-format yuv420p -c mkvmerge --sc-method fast -y -o "tt_sif.mkv" -v " --preset ultrafast --crf 0" --target-quality 95
du -h tt_sif.mkv
- name: Testing target-quality x264
run: |
target/ci/av1an -i tt_sif.y4m -e x264 --pix-format yuv420p --sc-method fast -y -o "tt_sif.mkv" -v " --preset ultrafast --crf 0" --target-quality 95
du -h tt_sif.mkv
- name: Testing probe-slow aom
run: |
target/ci/av1an -i tt_sif.y4m -e aom --pix-format yuv420p --sc-method fast -y -o "tt_sif.mkv" -v " --cpu-used=10 --rt --threads=4 --cq-level=0" -p1 --target-quality 95 --probe-slow
du -h tt_sif.mkv
- name: Testing probe-slow rav1e
run: |
target/ci/av1an -i tt_sif.y4m -e rav1e --pix-format yuv420p --sc-method fast -y -o "tt_sif.mkv" -v " --speed 10 --low-latency --quantizer 0" --target-quality 95 --probe-slow
du -h tt_sif.mkv
- name: Testing probe-slow svt-av1
run: |
target/ci/av1an -i tt_sif.y4m -e svt-av1 --pix-format yuv420p --sc-method fast -y -o "tt_sif.mkv" -v " --preset 8 --crf 0" --target-quality 95 --probe-slow
du -h tt_sif.mkv
- name: Testing probe-slow vpx
run: |
target/ci/av1an -i tt_sif.y4m -e vpx --pix-format yuv420p --sc-method fast -y -o "tt_sif.mkv" -v " --cpu-used=9 --rt --threads=4 --cq-level=0" -p1 --target-quality 95 --probe-slow
du -h tt_sif.mkv
- name: Testing probe-slow x265
run: |
target/ci/av1an -i tt_sif.y4m -e x265 --pix-format yuv420p -c mkvmerge --sc-method fast -y -o "tt_sif.mkv" -v " --preset ultrafast --crf 0" --target-quality 95 --probe-slow
du -h tt_sif.mkv
- name: Testing probe-slow x264
run: |
target/ci/av1an -i tt_sif.y4m -e x264 --pix-format yuv420p --sc-method fast -y -o "tt_sif.mkv" -v " --preset ultrafast --crf 0" --target-quality 95 --probe-slow
du -h tt_sif.mkv
- name: Testing chunk_hybrid aom
run: |
target/ci/av1an -i tt_sif.y4m -e aom --pix-format yuv420p --sc-method fast -y -o "tt_sif.mkv" -v " --cpu-used=10 --rt --threads=4" -p1 --chunk-method hybrid
du -h tt_sif.mkv
- name: Testing chunk_select aom
run: |
target/ci/av1an -i tt_sif.y4m -e aom --pix-format yuv420p --sc-method fast -y -o "tt_sif.mkv" -v " --cpu-used=10 --rt --threads=4" -p1 --chunk-method select
du -h tt_sif.mkv
- name: Testing chunk_ffms2 aom
run: |
target/ci/av1an -i tt_sif.y4m -e aom --pix-format yuv420p --sc-method fast -y -o "tt_sif.mkv" -v " --cpu-used=10 --rt --threads=4" -p1 --chunk-method ffms2
du -h tt_sif.mkv
- name: Testing chunk_lsmash aom
run: |
target/ci/av1an -i tt_sif.y4m -e aom --pix-format yuv420p --sc-method fast -y -o "tt_sif.mkv" -v " --cpu-used=10 --rt --threads=4" -p1 --chunk-method lsmash
du -h tt_sif.mkv
- name: Testing scenes aom
run: |
target/ci/av1an -i tt_sif.y4m -e aom --pix-format yuv420p --sc-method fast -y -o "tt_sif.mkv" -v " --cpu-used=10 --rt --threads=4" -p1 -s scenes.json
du -h tt_sif.mkv
- name: Testing workers aom
run: |
target/ci/av1an -i tt_sif.y4m -e aom --pix-format yuv420p --sc-method fast -y -o "tt_sif.mkv" -v " --cpu-used=10 --rt --threads=4" -p1 -w 2
du -h tt_sif.mkv
- name: Testing vmaf aom
run: |
target/ci/av1an -i tt_sif.y4m -e aom --pix-format yuv420p --sc-method fast -y -o "tt_sif.mkv" -v " --cpu-used=10 --rt --threads=4" -p1 --vmaf
du -h tt_sif.mkv
- name: Testing extra_splits aom
run: |
target/ci/av1an -i tt_sif.y4m -e aom --pix-format yuv420p --sc-method fast -y -o "tt_sif.mkv" -v " --cpu-used=10 --rt --threads=4" -p1 -x 10
du -h tt_sif.mkv
- name: Testing temp aom
run: |
target/ci/av1an -i tt_sif.y4m -e aom --pix-format yuv420p --sc-method fast -y -o "tt_sif.mkv" -v " --cpu-used=10 --rt --threads=4" -p1 --temp temporary
du -h tt_sif.mkv
- name: Testing concat mkvmerge aom
run: |
target/ci/av1an -i tt_sif.y4m -e aom --pix-format yuv420p --sc-method fast -y -o "tt_sif.mkv" -v " --cpu-used=10 --rt --threads=4" -p1 -c mkvmerge
du -h tt_sif.mkv
- name: Testing slow scenechange aom
run: |
target/ci/av1an -i tt_sif.y4m -e aom --pix-format yuv420p -y -o "tt_sif.mkv" -v " --cpu-used=10 --rt --threads=4" -p1 -c mkvmerge
du -h tt_sif.mkv
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: [all-tests, 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 }}