name: Plugins E2E (Linux)

on:
  push:
    branches: [ main, dev ]
  pull_request:
    branches: [ main, dev ]

jobs:
  plugins-e2e:
    runs-on: ubuntu-latest
    timeout-minutes: 15
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Setup Rust
        uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
          override: true

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

      - name: Build (release)
        run: cargo build --release -j2

      - name: Run E2E with plugins (Linux)
        env:
          RUST_BACKTRACE: 1
          NYASH_NET_LOG: "0"
        run: |
          cargo test --features plugins -q -- --nocapture

