Run validity checks on non-animated images while using the apng flag #127
Workflow file for this run
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: Build | |
on: [push] | |
jobs: | |
build: | |
strategy: | |
matrix: | |
mode: [ debug , release ] | |
os: [ ubuntu, windows ] | |
include: | |
- mode: debug | |
mode_flag: "" | |
- mode: release | |
mode_flag: "--release" | |
- os: ubuntu | |
exe_suffix: "" | |
sng: /usr/bin/sng | |
- os: windows | |
exe_suffix: .exe | |
sng: C:\tools\cygwin\bin\sng.exe | |
env: | |
SNG: ${{ matrix.sng }} | |
runs-on: ${{ matrix.os }}-latest | |
name: ${{ matrix.os }}-${{ matrix.mode }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache cargo registry | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cargo/registry/ | |
key: cargo-${{ matrix.os }}-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
cargo-${{ matrix.os }}- | |
- name: Build | |
run: cargo build --verbose ${{ matrix.mode_flag }} | |
- uses: actions/upload-artifact@master | |
with: | |
name: png_inflate-${{ matrix.os }}-${{ matrix.mode }}${{ matrix.exe_suffix }} | |
path: target/${{ matrix.mode }}/png_inflate${{ matrix.exe_suffix }} | |
# | |
- name: Install test dependencies (ubuntu) | |
if: ${{ matrix.os == 'ubuntu' }} | |
run: sudo apt-get -yq install sng | |
- name: Install test dependencies (Windows) | |
if: ${{ matrix.os == 'windows' }} | |
shell: pwsh | |
run: | | |
& choco install Cygwin | |
& C:\tools\cygwin\cygwinsetup.exe --no-admin -q -P sng | |
- name: Run tests | |
run: cargo test --verbose ${{matrix.mode_flag}} | |
check_fmt: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: cargo fmt | |
run: cargo fmt --all -- --check | |
- name: Check Sorted | |
run: 'sort --check -- rustfmt.toml' | |
clippy_lint: | |
runs-on: ubuntu-latest | |
env: | |
SNG: 'arbitrary value' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache cargo registry | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cargo/registry/ | |
key: cargo-ubuntu-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
cargo-ubuntu- | |
- name: cargo clippy | |
run: cargo clippy --all-targets --all-features -- -D warnings |