Skip to content

matrify workflow

matrify workflow #300

Workflow file for this run

# Copyright (c) the JPEG XL Project Authors. All rights reserved.
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
# Workflow to run pull-requests specific checks.
name: PR
on:
pull_request:
types: [opened, reopened, synchronize]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
# Run source tests: author list, copyright notice and merge conflicts.
authors:
runs-on: [ubuntu-latest]
steps:
- name: Checkout the source
uses: actions/checkout@v4
- name: Check AUTHORS file
run:
./ci/pull_request_checks.sh
checks:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
check: [format, clippy, test]
features: [all, default]
exclude:
# Remove the "format+all" combination, since it is the same as "format+default"
- check: format
features: all
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install latest rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Rust cache
uses: Swatinem/[email protected]
# format
- name: Cargo fmt (check)
if: ${{ matrix.check == 'format' }}
run: cargo fmt --all -- --check
# clippy
- name: Clippy with all features
if: ${{ matrix.check == 'clippy' && matrix.features == 'all' }}
run: cargo clippy --release --all-targets --all-features --tests --all -- -D warnings
- name: Clippy with default features
if: ${{ matrix.check == 'clippy' && matrix.features == 'default' }}
run: cargo clippy --release --all-targets --tests --all -- -D warnings
# test
- name: Tests with all features
if: ${{ matrix.check == 'test' && matrix.features == 'all' }}
run: cargo test --release --all --no-fail-fast --all-features
- name: Tests with default features
if: ${{ matrix.check == 'test' && matrix.features == 'default' }}
run: cargo test --release --all --no-fail-fast