nu_plugin_jev 0.1.1

Nushell plugin for TypeSafe Jev structured decisions
name: Verify

on:
  workflow_call:
  workflow_dispatch:

permissions:
  contents: read

env:
  CARGO_TERM_COLOR: always

jobs:
  checks:
    name: Rust, Nu, and OpenSpec
    runs-on: ubuntu-latest
    steps:
      - name: Check out source
        uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false
      - name: Install Rust
        uses: dtolnay/rust-toolchain@7e38f4b43b4db5c8dd498af069a4f6196df1d067 # v1
        with:
          toolchain: 1.99.0
          components: clippy, rustfmt
      - name: Restore Cargo cache
        uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
      - name: Install cargo-nextest
        uses: taiki-e/install-action@83ac0ad63c0167e6f06796fab0fce28db1bf3db0 # v2.87.22
        with:
          tool: nextest@0.9.146
      - name: Install matching Nushell
        shell: bash
        env:
          NU_VERSION: 0.116.0
          NU_SHA256: 9f73a6913f9515a621bd916dc91d7f3e0494e488161c2d686f6b98ffa0555945
        run: |
          archive="$RUNNER_TEMP/nu-${NU_VERSION}.tar.gz"
          curl --fail --location --retry 3 --output "$archive" \
            "https://github.com/nushell/nushell/releases/download/${NU_VERSION}/nu-${NU_VERSION}-x86_64-unknown-linux-gnu.tar.gz"
          printf '%s  %s\n' "$NU_SHA256" "$archive" | sha256sum --check -
          mkdir -p "$RUNNER_TEMP/nu-release" "$RUNNER_TEMP/nu-bin"
          tar -xzf "$archive" -C "$RUNNER_TEMP/nu-release"
          nu_binary="$(find "$RUNNER_TEMP/nu-release" -type f -name nu -print -quit)"
          test -n "$nu_binary"
          install -m 755 "$nu_binary" "$RUNNER_TEMP/nu-bin/nu"
          echo "$RUNNER_TEMP/nu-bin" >> "$GITHUB_PATH"
      - name: Verify Nushell version
        run: test "$(nu --version)" = "0.116.0"
      - name: Run repository hooks
        uses: j178/prek-action@4e14d07f9231acabce116ccfca13b13dd9755ece # v3.0.0
        with:
          extra-args: --all-files
          prek-version: 0.5.4
      - name: Test without mimalloc
        run: cargo nextest run --all-targets --no-default-features --locked
      - name: Check publishable crate
        shell: bash
        run: cargo package --offline --locked --no-verify

  security:
    name: Dependency policy
    runs-on: ubuntu-latest
    steps:
      - name: Check out source
        uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false
      - name: Check advisories and licenses
        uses: EmbarkStudios/cargo-deny-action@3c6349835b2b7b196a839186cb8b78e02f7b5f25 # v2.1.1
        with:
          command: check advisories licenses
          rust-version: 1.99.0