fn_graph 0.18.0

Runs interdependent logic concurrently, starting each function when predecessors have completed.
Documentation
on:
  push:
    tags:
      - '*'

name: Publish

jobs:
  audit:
    name: Audit
    runs-on: ubuntu-latest
    timeout-minutes: 10
    steps:
      - uses: actions/checkout@v4
        # Needed for audit-check@v2
      - name: generate Cargo.lock
        run: cargo generate-lockfile
      - uses: rustsec/audit-check@v2
        with:
          token: ${{ secrets.GITHUB_TOKEN }}

  build_and_test_linux:
    name: Build and Test (Linux)
    runs-on: ubuntu-latest
    timeout-minutes: 10
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable

      - uses: taiki-e/install-action@nextest
      - name: 'Build and test'
        run: cargo nextest run --workspace --all-targets --all-features

  build_and_test_windows:
    name: Build and Test (Windows)
    runs-on: windows-latest
    timeout-minutes: 10
    steps:
      - name: Prepare symlink configuration
        run: git config --global core.symlinks true

      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable

      - uses: taiki-e/install-action@nextest
      - name: 'Build and test'
        run: cargo nextest run --workspace --all-targets --all-features

  crates_io_publish:
    name: Publish (crates.io)
    needs:
      - audit
      - build_and_test_linux
      - build_and_test_windows

    runs-on: ubuntu-latest
    timeout-minutes: 10
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable

      - name: cargo-release cache restore
        id: cargo_release_cache_restore
        uses: actions/cache/restore@v4
        with:
          path: ~/.cargo/bin/cargo-release
          key: ${{ runner.os }}-cargo-release

      - run: cargo install cargo-release
        if: steps.cargo_release_cache_restore.outputs.cache-hit != 'true'

      - name: cargo-release cache save
        id: cargo_release_cache_save
        uses: actions/cache/save@v4
        if: always() && steps.cargo_release_cache_restore.outputs.cache-hit != 'true'
        with:
          path: ~/.cargo/bin/cargo-release
          key: ${{ runner.os }}-cargo-release

      - name: cargo login
        run: |-
          echo "${{ secrets.CRATES_IO_API_TOKEN }}" | cargo login

      - name: "cargo release publish"
        run: |-
          cargo release \
            publish \
            --workspace \
            --all-features \
            --allow-branch HEAD \
            --no-confirm \
            --execute