cxx-enumext 0.0.3

Generate cxx compatable `Trivial` bindings for rust enum types
Documentation
name: CI

on:
  push:
    branches:
      - main
  pull_request: {}

env:
  # Disable incremental compilation.
  #
  # Incremental compilation is useful as part of an edit-build-test-edit cycle,
  # as it lets the compiler avoid recompiling code that hasn't changed. However,
  # on CI, we're not making small edits; we're almost always building the entire
  # project from scratch. Thus, incremental compilation on CI actually
  # introduces *additional* overhead to support making future builds
  # faster...but no future builds will ever occur in any given CI environment.
  #
  # See https://matklad.github.io/2021/09/04/fast-rust-builds.html#ci-workflow
  # for details.
  CARGO_INCREMENTAL: 0
  # Allow more retries for network requests in cargo (downloading crates) and
  # rustup (installing toolchains). This should help to reduce flaky CI failures
  # from transient network timeouts or other issues.
  CARGO_NET_RETRY: 10
  RUSTUP_MAX_RETRIES: 10
  # Don't emit giant backtraces in the CI logs.
  RUST_BACKTRACE: short

jobs:
  ### check jobs ###

  check:
    # Run `cargo check` first to ensure that the pushed code at least compiles.
    name: cargo check
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - name: Check
        run: cargo check --all --tests --benches

  style:
    # Check style.
    name: cargo fmt
    needs: check
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt
      - name: rustfmt
        run: cargo fmt --all -- --check

  warnings:
    # Check for any warnings. This is informational and thus is allowed to fail.
    runs-on: ubuntu-latest
    needs: check
    permissions:
      checks: write
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy
      - name: Clippy
        uses: actions-rs/clippy-check@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          args: --all --examples --tests --benches

  test:
    # Test against stable Rust across macOS, Windows, and Linux, and against
    # beta and nightly rust on Ubuntu.
    name: "cargo test (${{ matrix.rust }} on ${{ matrix.os }})"
    needs: check
    strategy:
      matrix:
        # test all Rust versions on ubuntu-latest
        os: [ubuntu-latest]
        rust: [stable, beta, nightly]
        # test stable Rust on Windows and MacOS as well
        include:
          - rust: stable
            os: windows-latest
          - rust: stable
            os: macos-latest
      fail-fast: false
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v4
      - name: "install Rust ${{ matrix.rust }}"
        uses: dtolnay/rust-toolchain@master
        with:
          toolchain: ${{ matrix.rust }}
      - name: Run tests
        run: |
          cargo test