|
| 1 | +name: rav1e |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - master |
| 10 | + |
| 11 | +jobs: |
| 12 | + rustfmt-clippy: |
| 13 | + |
| 14 | + runs-on: ubuntu-latest |
| 15 | + |
| 16 | + steps: |
| 17 | + - uses: actions/checkout@v1 |
| 18 | + - name: Install nasm |
| 19 | + run: | |
| 20 | + sudo apt-get install nasm |
| 21 | + - name: Install stable |
| 22 | + uses: actions-rs/toolchain@v1 |
| 23 | + with: |
| 24 | + profile: minimal |
| 25 | + toolchain: stable |
| 26 | + override: true |
| 27 | + components: clippy, rustfmt |
| 28 | + - name: Run rustfmt |
| 29 | + uses: actions-rs/cargo@v1 |
| 30 | + with: |
| 31 | + command: fmt |
| 32 | + args: -- --check --verbose |
| 33 | + - name: Run clippy |
| 34 | + uses: actions-rs/clippy-check@v1 |
| 35 | + with: |
| 36 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 37 | + args: -- -D warnings --verbose -A clippy::wrong-self-convention |
| 38 | + |
| 39 | + build-unix: |
| 40 | + |
| 41 | + strategy: |
| 42 | + matrix: |
| 43 | + conf: |
| 44 | + - 1.36.0-tests |
| 45 | + - aom-tests |
| 46 | + - dav1d-tests |
| 47 | + - grcov-coveralls |
| 48 | + - bench |
| 49 | + - doc |
| 50 | + - check-no-default |
| 51 | + - check-extra-feats |
| 52 | + include: |
| 53 | + - conf: 1.36.0-tests |
| 54 | + toolchain: 1.36.0 |
| 55 | + - conf: aom-tests |
| 56 | + toolchain: stable |
| 57 | + - conf: dav1d-tests |
| 58 | + toolchain: stable |
| 59 | + - conf: grcov-coveralls |
| 60 | + toolchain: nightly |
| 61 | + - conf: bench |
| 62 | + toolchain: stable |
| 63 | + - conf: doc |
| 64 | + toolchain: stable |
| 65 | + - conf: check-no-default |
| 66 | + toolchain: stable |
| 67 | + - conf: check-extra-feats |
| 68 | + toolchain: stable |
| 69 | + |
| 70 | + env: |
| 71 | + RUST_BACKTRACE: 1 |
| 72 | + DAV1D_DIR: dav1d-dir |
| 73 | + AOM_DIR: aom-dir |
| 74 | + |
| 75 | + runs-on: ubuntu-latest |
| 76 | + |
| 77 | + steps: |
| 78 | + - uses: actions/checkout@v1 |
| 79 | + - name: Install deps |
| 80 | + run: | |
| 81 | + sudo apt-get install libsdl2-dev libvulkan-dev libcurl4-openssl-dev \ |
| 82 | + zlib1g-dev libdw-dev libiberty-dev |
| 83 | + - name: Install nasm |
| 84 | + run: | |
| 85 | + sudo apt-get install nasm |
| 86 | + - name: Install Python3 packages |
| 87 | + if: > |
| 88 | + matrix.conf == '1.36.0-tests' || matrix.conf == 'dav1d-tests' || |
| 89 | + matrix.conf == 'grcov-coveralls' |
| 90 | + run: | |
| 91 | + sudo apt-get install python3-setuptools python3-wheel |
| 92 | + - name: Install meson |
| 93 | + if: > |
| 94 | + matrix.conf == '1.36.0-tests' || matrix.conf == 'dav1d-tests' || |
| 95 | + matrix.conf == 'grcov-coveralls' |
| 96 | + run: | |
| 97 | + sudo pip3 install meson |
| 98 | + - name: Install ninja |
| 99 | + if: > |
| 100 | + matrix.conf == '1.36.0-tests' || matrix.conf == 'dav1d-tests' || |
| 101 | + matrix.conf == 'aom-tests' || matrix.conf == 'grcov-coveralls' |
| 102 | + run: | |
| 103 | + sudo pip3 install ninja |
| 104 | + - name: Install aom |
| 105 | + if: > |
| 106 | + matrix.conf == '1.36.0-tests' || matrix.conf == 'aom-tests' || |
| 107 | + matrix.conf == 'grcov-coveralls' |
| 108 | + env: |
| 109 | + LINK: https://aomedia.googlesource.com/aom |
| 110 | + AOM_VERSION: 1.0.0-errata1 |
| 111 | + run: | |
| 112 | + git clone --depth 1 -b "v$AOM_VERSION" $LINK "aom-$AOM_VERSION" |
| 113 | + cd aom-$AOM_VERSION |
| 114 | + rm -rf CMakeCache.txt CMakeFiles |
| 115 | + mkdir -p build |
| 116 | + cd build |
| 117 | + cmake -GNinja .. \ |
| 118 | + -DCMAKE_INSTALL_PREFIX=$HOME/$AOM_DIR \ |
| 119 | + -DCMAKE_BUILD_TYPE=Release \ |
| 120 | + -DENABLE_TESTS=0 \ |
| 121 | + -DENABLE_DOCS=0 \ |
| 122 | + -DCONFIG_LOWBITDEPTH=1 \ |
| 123 | + -DCONFIG_PIC=1 |
| 124 | + ninja |
| 125 | + ninja install |
| 126 | + - name: Install dav1d |
| 127 | + if: > |
| 128 | + matrix.conf == '1.36.0-tests' || matrix.conf == 'dav1d-tests' || |
| 129 | + matrix.conf == 'grcov-coveralls' |
| 130 | + env: |
| 131 | + LINK: https://code.videolan.org/videolan/dav1d/-/archive/ |
| 132 | + DAV1D_VERSION: 0.4.0 |
| 133 | + run: | |
| 134 | + curl -L "$LINK/$DAV1D_VERSION/dav1d-$DAV1D_VERSION.tar.gz" | tar xz |
| 135 | + cd dav1d-$DAV1D_VERSION |
| 136 | + meson build --buildtype release -Dprefix=$HOME/$DAV1D_DIR |
| 137 | + ninja -C build install |
| 138 | + - name: Install stable |
| 139 | + uses: actions-rs/toolchain@v1 |
| 140 | + with: |
| 141 | + profile: minimal |
| 142 | + toolchain: ${{ matrix.toolchain }} |
| 143 | + override: true |
| 144 | + - name: Run 1.36.0 tests |
| 145 | + if: matrix.toolchain == '1.36.0' && matrix.conf == '1.36.0-tests' |
| 146 | + run: | |
| 147 | + DAV1D="$HOME/$DAV1D_DIR/lib/x86_64-linux-gnu" |
| 148 | + export PKG_CONFIG_PATH=$HOME/$AOM_DIR/lib/pkgconfig:$DAV1D/pkgconfig |
| 149 | + export LD_LIBRARY_PATH=$HOME/$AOM_DIR/lib:$DAV1D |
| 150 | + cargo test --verbose \ |
| 151 | + --features=decode_test,decode_test_dav1d,quick_test,capi |
| 152 | + - name: Run aom tests |
| 153 | + if: matrix.toolchain == 'stable' && matrix.conf == 'aom-tests' |
| 154 | + run: | |
| 155 | + export PKG_CONFIG_PATH=$HOME/$AOM_DIR/lib/pkgconfig |
| 156 | + export LD_LIBRARY_PATH=$HOME/$AOM_DIR/lib |
| 157 | + cargo test --verbose --release \ |
| 158 | + --features=decode_test \ |
| 159 | + --color=always -- --color=always --ignored |
| 160 | + - name: Run dav1d tests |
| 161 | + if: matrix.toolchain == 'stable' && matrix.conf == 'dav1d-tests' |
| 162 | + run: | |
| 163 | + export PKG_CONFIG_PATH=$HOME/$DAV1D_DIR/lib/x86_64-linux-gnu/pkgconfig |
| 164 | + export LD_LIBRARY_PATH=$HOME/$DAV1D_DIR/lib/x86_64-linux-gnu |
| 165 | + cargo test --verbose --release \ |
| 166 | + --features=decode_test_dav1d \ |
| 167 | + --color=always -- --color=always --ignored |
| 168 | + - name: Run bench |
| 169 | + if: matrix.toolchain == 'stable' && matrix.conf == 'bench' |
| 170 | + run: | |
| 171 | + cargo bench --features=bench --no-run --verbose |
| 172 | + - name: Run doc |
| 173 | + if: matrix.toolchain == 'stable' && matrix.conf == 'doc' |
| 174 | + run: | |
| 175 | + cargo doc --verbose --no-deps |
| 176 | + - name: Check no default features |
| 177 | + if: matrix.toolchain == 'stable' && matrix.conf == 'check-no-default' |
| 178 | + run: | |
| 179 | + cargo check --no-default-features |
| 180 | + - name: Check extra features |
| 181 | + if: matrix.toolchain == 'stable' && matrix.conf == 'check-extra-feats' |
| 182 | + run: | |
| 183 | + cargo check --features=capi,dump_lookahead_data |
| 184 | + - name: Run cargo clean |
| 185 | + if: matrix.conf == 'grcov-coveralls' |
| 186 | + uses: actions-rs/cargo@v1 |
| 187 | + with: |
| 188 | + command: clean |
| 189 | + - name: Run tests |
| 190 | + if: matrix.conf == 'grcov-coveralls' |
| 191 | + env: |
| 192 | + CARGO_INCREMENTAL: '0' |
| 193 | + RUSTFLAGS: > |
| 194 | + -Zprofile -Ccodegen-units=1 -Clink-dead-code -Coverflow-checks=off |
| 195 | + -Zno-landing-pads |
| 196 | + run: | |
| 197 | + DAV1D="$HOME/$DAV1D_DIR/lib/x86_64-linux-gnu" |
| 198 | + export PKG_CONFIG_PATH=$HOME/$AOM_DIR/lib/pkgconfig:$DAV1D/pkgconfig |
| 199 | + export LD_LIBRARY_PATH=$HOME/$AOM_DIR/lib:$DAV1D |
| 200 | + cargo test --features=decode_test,decode_test_dav1d,quick_test --verbose |
| 201 | + - name: Run grcov |
| 202 | + if: matrix.conf == 'grcov-coveralls' |
| 203 | + id: coverage |
| 204 | + uses: actions-rs/[email protected] |
| 205 | + - name: Coveralls upload |
| 206 | + if: matrix.conf == 'grcov-coveralls' |
| 207 | + uses: coverallsapp/github-action@master |
| 208 | + with: |
| 209 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 210 | + path-to-lcov: ${{ steps.coverage.outputs.report }} |
| 211 | + |
| 212 | + build-windows: |
| 213 | + |
| 214 | + env: |
| 215 | + RUST_BACKTRACE: 1 |
| 216 | + VS_PATH: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise |
| 217 | + COMPILER_SUBPATH: VC\Tools\MSVC\14.23.28105\bin\Hostx64\x64 |
| 218 | + |
| 219 | + runs-on: windows-latest |
| 220 | + |
| 221 | + steps: |
| 222 | + - uses: actions/checkout@v1 |
| 223 | + - name: Install nasm |
| 224 | + run: | |
| 225 | + $NASM_VERSION="nasm-2.14.02" |
| 226 | + curl -LO "https://people.xiph.org/~tdaede/$NASM_VERSION-win64.zip" |
| 227 | + 7z e -y "$NASM_VERSION-win64.zip" -o"C:\nasm" |
| 228 | + - name: Install Rust |
| 229 | + uses: actions-rs/toolchain@v1 |
| 230 | + with: |
| 231 | + profile: minimal |
| 232 | + toolchain: stable |
| 233 | + override: true |
| 234 | + - name: Build |
| 235 | + run: | |
| 236 | + $Env:Path += ";$Env:VS_PATH\$Env:COMPILER_SUBPATH;C:\nasm;" |
| 237 | + cargo build --release |
| 238 | + - name: Test |
| 239 | + run: | |
| 240 | + $Env:Path += ";$Env:VS_PATH\$Env:COMPILER_SUBPATH;C:\nasm;" |
| 241 | + cargo test --verbose |
0 commit comments