tauri-plugin-tracing 0.3.3

Use the tracing crate in your Tauri app
Documentation
name: Check Rust

on:
  push:
    branches: [main]
    paths:
      - '.github/workflows/check-rust.yml'
      - 'src/**'
      - '!./dist-js/**'
      - '**/Cargo.toml'
  pull_request:
    branches: [main]
    paths:
      - '.github/workflows/check-rust.yml'
      - 'src/**'
      - '!./dist-js/**'
      - '**/Cargo.toml'

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

env:
  SCCACHE_GHA_ENABLED: 'true'
  RUSTC_WRAPPER: 'sccache'
  CARGO_TERM_COLOR: always
  RUSTFLAGS: '-D warnings'

jobs:
  changes:
    runs-on: ubuntu-latest
    permissions:
      pull-requests: read
      contents: read
    outputs:
      packages: ${{ steps.filter.outputs.changes }}
    steps:
      - uses: actions/checkout@v4
      - uses: dorny/paths-filter@v2
        id: filter
        with:
          filters: |
            tauri-plugin-tracing:
              - .github/workflows/check-rust.yml
              - ./**

  clippy:
    needs: changes
    if: ${{ needs.changes.outputs.packages != '[]' && needs.changes.outputs.packages != '' }}
    runs-on: ubuntu-22.04
    strategy:
      fail-fast: false
      matrix:
        package: ${{ fromJSON(needs.changes.outputs.packages) }}

    steps:
      - uses: mozilla-actions/sccache-action@v0.0.9
      - uses: actions/checkout@v4

      - name: install webkit2gtk
        run: |
          sudo apt-get update
          sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev

      - name: Install clippy with stable toolchain
        uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy

      - uses: Swatinem/rust-cache@v2

      - name: clippy ${{ matrix.package }}
        run: cargo clippy --package ${{ matrix.package }} --all-targets -- -D warnings

      - name: clippy ${{ matrix.package }} --all-features
        run: cargo clippy --package ${{ matrix.package }} --all-targets --all-features -- -D warnings

  test:
    needs: changes
    if: ${{ needs.changes.outputs.packages != '[]' && needs.changes.outputs.packages != '' }}
    runs-on: ubuntu-22.04

    steps:
      - uses: mozilla-actions/sccache-action@v0.0.9
      - uses: actions/checkout@v4

      - name: install webkit2gtk
        run: |
          sudo apt-get update
          sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev

      - name: Install stable toolchain
        uses: dtolnay/rust-toolchain@stable

      - name: Install cargo-nextest
        uses: taiki-e/install-action@nextest

      - uses: Swatinem/rust-cache@v2

      - name: test workspace
        run: cargo nextest run --workspace

      - name: test workspace --all-features
        run: cargo nextest run --workspace --all-features

      - name: doc tests
        run: cargo test --doc --all-features