euclid 0.22.14

Geometry primitives
Documentation
name: CI

on:
  push:
    branches: [main]
  pull_request:
  workflow_dispatch:
  merge_group:
    types: [checks_requested]

jobs:
  linux-ci:
    name: Linux
    runs-on: ubuntu-latest
    strategy:
      matrix:
        features: ["", "--features serde", "--no-default-features --features libm"]
        version: ["1.63.0", "stable", "beta", "nightly"]
        include:
          - version: stable
            features: --features mint
          - version: stable
            features: --features bytemuck
          - version: stable
            features: --features arbitrary
          - version: stable
            features: --features malloc_size_of
          - version: nightly
            features: --features unstable
          - version: nightly
            features: --features unstable,serde

    steps:
      - uses: actions/checkout@v4

      - name: Install toolchain
        uses: dtolnay/rust-toolchain@v1
        with:
          toolchain: ${{ matrix.version }}

      - name: Cargo build
        run: cargo build ${{ matrix.features }}

      - name: Cargo test
        run: cargo test ${{ matrix.features }}
        env:
          RUST_BACKTRACE: 1

  minimal-no-std:
    name: Check that no-std builds (with a reduced featureset) without libm
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: cargo check --no-default-features

  fmt:
    name: Check code formatting
    runs-on: ubuntu-latest
    steps:
      # GitHub runners already have a usable version of cargo & rustfmt, so an install is not needed
      - uses: actions/checkout@v4
      - run: cargo fmt --check

  build_result:
    name: Result
    runs-on: ubuntu-latest
    needs:
      - "linux-ci"

    steps:
      - name: Mark the job as successful
        run: exit 0
        if: success()
      - name: Mark the job as unsuccessful
        run: exit 1
        if: "!success()"