easy_fuser 0.7.1

A flexible and idiomatic Fuse implementation for Rust
Documentation
name: CI Ubuntu

on:
  workflow_dispatch:
  push:
    branches: [ main, devel ]
  pull_request:
    types: [ opened, synchronize, reopened, ready_for_review ]
    branches: [ main, devel ]

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
  cancel-in-progress: true

jobs:
  build_and_test:
    if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
    name: "Main tests"
    runs-on: ubuntu-latest
    strategy:
      matrix:
        include:
          - toolchain: stable
            feature: serial
          - toolchain: stable
            feature: parallel
          - toolchain: stable
            feature: async
          - toolchain: nightly
            feature: async
    
    steps:
    - uses: actions/checkout@v4
    - name: Install libfuse-dev
      run: |
        sudo apt-get update
        sudo apt-get install -y libfuse-dev
    - name: Set PKG_CONFIG_PATH
      run: echo "PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig" >> $GITHUB_ENV
    - name: Setup Rust
      uses: dtolnay/rust-toolchain@master
      with:
        toolchain: ${{ matrix.toolchain }}
    - uses: Swatinem/rust-cache@v2
      with:
        shared-key: ubuntu-${{ matrix.toolchain }}
    - name: Run tests
      run: cargo test --no-default-features --features ${{ matrix.feature }}

  discover_examples:
    if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
    name: Discover example crates
    runs-on: ubuntu-latest
    outputs:
      examples: ${{ steps.set-matrix.outputs.examples }}
    steps:
    - uses: actions/checkout@v4
    - id: set-matrix
      run: |
        examples=$(find examples -mindepth 2 -maxdepth 2 -name Cargo.toml -printf '%h\n' \
          | sed 's#^examples/##' \
          | jq -R -s -c 'split("\n") | map(select(length > 0))')
        echo "examples=$examples" >> "$GITHUB_OUTPUT"

  test_examples:
    needs: discover_examples
    if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
    name: "Example ${{ matrix.example }}"
    runs-on: ubuntu-latest
    strategy:
      matrix:
        example: ${{ fromJSON(needs.discover_examples.outputs.examples) }}
    steps:
    - uses: actions/checkout@v4
    - name: Setup Rust
      uses: dtolnay/rust-toolchain@stable
    - uses: Swatinem/rust-cache@v2
      with:
        workspaces: examples/${{ matrix.example }} -> target
        shared-key: example-${{ matrix.example }}
    - name: Install libfuse-dev
      run: |
        sudo apt-get update
        sudo apt-get install -y libfuse-dev
    - name: Set PKG_CONFIG_PATH
      run: echo "PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig" >> $GITHUB_ENV
    - name: Test ${{ matrix.example }}
      working-directory: examples/${{ matrix.example }}
      run: cargo test

  check_i686:
    if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
    name: "Check i686 compilation"
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - name: Install libfuse-dev and gcc-multilib
      run: |
        sudo dpkg --add-architecture i386
        sudo apt-get update
        sudo apt-get install -y libfuse-dev:i386 gcc-multilib
    - name: Setup Rust
      uses: dtolnay/rust-toolchain@stable
      with:
        targets: i686-unknown-linux-gnu
    - uses: Swatinem/rust-cache@v2
      with:
        shared-key: ubuntu-i686-stable
    - name: Check
      env:
        PKG_CONFIG_ALLOW_CROSS: 1
        PKG_CONFIG_PATH: /usr/lib/i386-linux-gnu/pkgconfig
      run: cargo check --target=i686-unknown-linux-gnu --features serial

  check_musl:
    if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
    name: "Check musl compilation"
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - name: Install musl-tools
      run: |
        sudo apt-get update
        sudo apt-get install -y musl-tools
    - name: Setup Rust
      uses: dtolnay/rust-toolchain@stable
      with:
        targets: x86_64-unknown-linux-musl
    - uses: Swatinem/rust-cache@v2
      with:
        shared-key: ubuntu-musl-stable
    - name: Check
      run: cargo check --target=x86_64-unknown-linux-musl --features serial