oxipng/.github/workflows/oxipng.yml
Ingvar Stepanyan 7167a5e44d
Use the new stabilised fetch_min (#328)
A minor simplification using the corresponding new standard library function.

Bumps minimum Rust version to 1.45.0
2020-10-11 18:53:00 -04:00

92 lines
2.6 KiB
YAML

name: oxipng
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test:
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
- x86_64-pc-windows-msvc
- x86_64-apple-darwin
toolchain:
# Minimum stable
- "1.45.0"
- stable
- beta
- nightly
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
- target: x86_64-pc-windows-msvc
os: windows-latest
- target: x86_64-apple-darwin
os: macOS-latest
exclude:
- target: x86_64-pc-windows-msvc
toolchain: beta
- target: x86_64-pc-windows-msvc
toolchain: nightly
- target: x86_64-apple-darwin
toolchain: beta
- target: x86_64-apple-darwin
toolchain: nightly
- target: x86_64-unknown-linux-musl
toolchain: beta
- target: x86_64-unknown-linux-musl
toolchain: nightly
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Install musl tools
run: sudo apt-get install musl-tools
if: "contains(matrix.target, 'musl')"
- name: Install ${{ matrix.toolchain }}
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
override: true
components: clippy, rustfmt
- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry/cache
key: ${{ matrix.target }}-${{ matrix.toolchain }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ matrix.target }}-${{ matrix.toolchain }}-cargo-registry-
- name: Run rustfmt
if: matrix.toolchain == 'stable'
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check
- name: Run clippy
if: matrix.toolchain == 'stable'
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: -- -D warnings
- name: Run tests
run: cargo test
- name: Build benchmarks
if: matrix.toolchain == 'nightly'
run: cargo bench --no-run
- name: Build docs
run: cargo doc --no-deps
- name: Check no default features
if: matrix.toolchain == 'stable'
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --no-default-features -- -D warnings