Configure Mend Bolt for GitHub #10
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: oxipng | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
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.65.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 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
- name: Install musl tools | |
run: sudo apt-get install musl-tools | |
if: "contains(matrix.target, 'musl')" | |
- name: Cache cargo registry | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
key: ${{ runner.os }}-${{ matrix.toolchain }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.toolchain }}-cargo-registry- | |
- name: Install ${{ matrix.toolchain }} | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: ${{ matrix.toolchain }} | |
override: true | |
components: clippy, rustfmt | |
- 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 --features sanity-checks | |
- 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 |