name: "pyth-lazer-agent Rust Test Suite"
on:
  push:
    branches:
      - main
  pull_request:
    paths:
      - .github/workflows/ci-pyth-lazer-agent.yml
      - apps/pyth-lazer-agent/**

jobs:
  pyth-lazer-agent-rust-test-suite:
    name: pyth-lazer-agent Rust Test Suite
    runs-on: ubuntu-22.04
    defaults:
      run:
        working-directory: apps/pyth-lazer-agent
    steps:
      - uses: actions/checkout@v4
        with:
          submodules: recursive
      - uses: actions-rust-lang/setup-rust-toolchain@v1
      - name: Format check
        run: cargo fmt --all -- --check
        if: success() || failure()
      - name: Clippy check
        run: cargo clippy -p pyth-lazer-agent --all-targets -- --deny warnings
        if: success() || failure()
      - name: test
        run: cargo test -p pyth-lazer-agent
        if: success() || failure()
