Merge pull request #21 from kornelski/CVE-2023-4863 #59
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: test | |
on: [push, pull_request] | |
jobs: | |
test: | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
rust: [stable] | |
webp: [0.4.4, 0.5.2, 1.0.3, 1.1.0, 1.2.0] | |
webp_from: ["build"] | |
common_features: [""] | |
include: | |
- rust: stable | |
webp: 0.6.1 | |
webp_from: distr | |
common_features: "" | |
- rust: stable | |
webp: 1.2.0 | |
webp_from: bundled | |
common_features: "" | |
- rust: 1.34.0 | |
webp: 1.2.0 | |
webp_from: build | |
common_features: "" | |
- rust: beta | |
webp: 1.2.0 | |
webp_from: build | |
common_features: "" | |
- rust: nightly | |
webp: 1.2.0 | |
webp_from: build | |
common_features: "" | |
- rust: nightly | |
webp: 1.2.0 | |
webp_from: build | |
common_features: extern-types, | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: ${{ matrix.rust }} | |
override: true | |
- name: Install libwebp | |
run: sudo apt-get update && sudo apt-get install libwebp-dev -y; | |
if: matrix.webp_from == 'distr' | |
- name: Install libwebp | |
run: | | |
wget https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${{ matrix.webp }}.tar.gz | |
tar zxf libwebp-${{ matrix.webp }}.tar.gz | |
cd libwebp-${{ matrix.webp }} | |
./configure --enable-libwebpmux --enable-libwebpdemux | |
make | |
sudo make install | |
echo LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV | |
echo PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV | |
if: ${{ matrix.webp_from == 'build' }} | |
- name: Set __LIBWEBP_SYS_FORBID_BUILD | |
run: echo __LIBWEBP_SYS_FORBID_BUILD=1 >> $GITHUB_ENV | |
if: ${{ matrix.webp_from != 'bundled' }} | |
- name: Test 0.4 | |
run: | | |
cargo test --all --features "${{ matrix.common_features }}" | |
cargo test --all --features "${{ matrix.common_features }}demux" | |
cargo test --all --features "${{ matrix.common_features }}mux" | |
cargo test --all --features "${{ matrix.common_features }}demux,mux" | |
- name: Test 0.5 | |
run: | | |
cargo test --all --features "${{ matrix.common_features }}0_5" | |
cargo test --all --features "${{ matrix.common_features }}0_5,demux" | |
cargo test --all --features "${{ matrix.common_features }}0_5,mux" | |
cargo test --all --features "${{ matrix.common_features }}0_5,demux,mux" | |
if: matrix.webp >= '0.5' | |
- name: Test 0.6 | |
run: | | |
cargo test --all --features "${{ matrix.common_features }}0_6" | |
cargo test --all --features "${{ matrix.common_features }}0_6,demux" | |
cargo test --all --features "${{ matrix.common_features }}0_6,mux" | |
cargo test --all --features "${{ matrix.common_features }}0_6,demux,mux" | |
if: matrix.webp >= '0.6' | |
- name: Test 1.1 | |
run: | | |
cargo test --all --features "${{ matrix.common_features }}1_1" | |
cargo test --all --features "${{ matrix.common_features }}1_1,demux" | |
cargo test --all --features "${{ matrix.common_features }}1_1,mux" | |
cargo test --all --features "${{ matrix.common_features }}1_1,demux,mux" | |
if: matrix.webp >= '1.1' | |
- name: Test 1.2 | |
run: | | |
cargo test --all --features "${{ matrix.common_features }}1_2" | |
cargo test --all --features "${{ matrix.common_features }}1_2,demux" | |
cargo test --all --features "${{ matrix.common_features }}1_2,mux" | |
cargo test --all --features "${{ matrix.common_features }}1_2,demux,mux" | |
if: matrix.webp >= '1.2' | |
- name: Test static builds | |
run: | | |
cargo test --all --features "${{ matrix.common_features }}1_2,static" | |
cargo test --all --features "${{ matrix.common_features }}1_2,static,demux" | |
cargo test --all --features "${{ matrix.common_features }}1_2,static,mux" | |
cargo test --all --features "${{ matrix.common_features }}1_2,static,demux,mux" | |
if: matrix.webp_from == 'bundled' | |
- name: Test __doc_cfg | |
run: | | |
cargo doc --all --features "${{ matrix.common_features }}__doc_cfg" | |
if: matrix.rust == 'nightly' | |
- name: Check format | |
run: | | |
rustup component add rustfmt-preview | |
cargo fmt --all -- --check | |
if: matrix.rust == 'stable' |