uni_service 0.1.2

Universal service crate for building cross platform OS services
Documentation
name: CI

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main
  workflow_dispatch:

jobs:
  test:
    name: Test - ${{ matrix.build }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        build:
          - linux
          - macos
          - windows
        include:
          # Linux
          - build: linux
            label: linux_x64
            os: ubuntu-latest

          # Mac
          - build: macos
            label: macos_arm64
            os: macos-latest

          # Windows
          - build: windows
            label: windows_x64
            os: windows-latest

    steps:
        - name: Checkout source code
          uses: actions/checkout@v5

        - name: Setup Rust
          uses: actions-rust-lang/setup-rust-toolchain@v1
          with:
            components: llvm-tools-preview

        - name: Cache Rust
          uses: actions/cache@v4
          with:
            path: |
              ~/.cargo/registry
              ~/.cargo/git
              crates/target
            key: ${{ runner.os }}-cargo-coverage-${{ hashFiles('crates/Cargo.lock') }}
            restore-keys: |
              ${{ runner.os }}-cargo-coverage-

        - name: Install Rust Tools
          uses: taiki-e/install-action@v2
          with:
            tool: cargo-nextest, cargo-llvm-cov

        - name: Run tests
          run: cargo test --workspace --all-features

        - name: Run tests with coverage
          run: cargo llvm-cov nextest --output-path codecov.json --codecov --workspace --all-features

        - name: Upload coverage reports to Codecov
          uses: codecov/codecov-action@v5
          with:
              files: codecov.json
              token: ${{ secrets.CODECOV_TOKEN }}

        - name: Run tests (root)
          if: matrix.build != 'windows'
          run: |
            mkdir .cargo
            echo '[target.x86_64-unknown-linux-gnu]' > .cargo/config.toml
            echo "runner = 'sudo -E'" >> .cargo/config.toml
            echo '[target.aarch64-apple-darwin]' >> .cargo/config.toml
            echo "runner = 'sudo -E'" >> .cargo/config.toml
            cargo test --workspace --all-features