yang5 0.1.0

libyang5 bindings for Rust
Documentation
name: CI

on:
  push:
    branches:
      - "**"
  pull_request:
    branches:
      - "master"
      - "yang2"

env:
  CARGO_TERM_COLOR: always
  # Make sure CI fails on all warnings, including Clippy lints
  RUSTFLAGS: "-Dwarnings"

jobs:
  fmt:
    name: Code Formatting Check
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt
      - uses: Swatinem/rust-cache@v2
      - name: "rustfmt --check"
        run: |
          if ! cargo fmt --all --check; then
            printf "Please run \`cargo fmt --all\` locally to fix formatting errors.\nSee CONTRIBUTING.md for more details.\n" >&2
            exit 1
          fi

  clippy_check:
    name: Linter Check
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy
      - name: Run Clippy
        run: cargo clippy

  tests_and_coverage_report:
    name: Tests and Coverage Report
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Install Rust
        run: rustup update stable
      - name: Install cargo-llvm-cov
        uses: taiki-e/install-action@cargo-llvm-cov
      - name: Generate code coverage
        run: cargo llvm-cov --features bundled --codecov --output-path codecov.json
      - name: Upload to Codecov
        uses: codecov/codecov-action@v4
        if: github.event_name != 'pull_request'
        with:
          files: ./lcov.info
          fail_ci_if_error: false
          token: ${{ secrets.CODECOV_TOKEN }}

  tests_arm:
    name: Tests (Arm64)
    runs-on: ubuntu-24.04-arm
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - name: Run tests
        run: cargo test --features bundled