on:
pull_request:
branches: [ "master" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Build ${{ matrix.feature }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
feature: [ data, base-64, hex, percent, value, var-int, full, dev ]
steps:
- name: Git Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: clippy
- name: Build
run: cargo build --no-default-features --features ${{ matrix.feature }} --verbose
- name: Test
run: cargo test --no-default-features --features ${{ matrix.feature }} --verbose
- name: Lint
run: cargo clippy --no-default-features --features ${{ matrix.feature }} --all-targets -- -D warnings
build-default:
name: Build default
runs-on: ubuntu-latest
steps:
- name: Git Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: clippy
- name: Build
run: cargo build --verbose
- name: Test
run: cargo test --verbose
- name: Lint
run: cargo clippy --all-targets -- -D warnings
lint-all:
name: Lint All Features
runs-on: ubuntu-latest
steps:
- name: Git Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt, clippy
- name: Format
run: cargo fmt --check
- name: Lint
run: cargo clippy --all-targets --all-features -- -D warnings
cross-platform:
name: Build ${{ matrix.target }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: [ i686-unknown-linux-gnu, x86_64-unknown-linux-gnu ]
steps:
- name: Git Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: ${{ matrix.target }}
- name: Install 32-bit support
if: matrix.target == 'i686-unknown-linux-gnu'
run: sudo apt-get update && sudo apt-get install -y gcc-multilib
- name: Build
run: cargo build --all-features --target ${{ matrix.target }} --verbose
- name: Test
run: cargo test --all-features --target ${{ matrix.target }} --verbose
status:
name: Build
needs: [ build, build-default, lint-all, cross-platform ]
runs-on: ubuntu-latest
steps:
- run: echo "All checks passed."