name: Eagle Build

on:
  # Main pushes are covered by docker_build.yml which builds the same target
  pull_request:
    paths:
      - 'src/main/scala/**'
      - 'src/main/protobuf/net/eagle0/eagle/**'
      - 'src/main/protobuf/net/eagle0/common/**'
      - 'WORKSPACE'
      - 'MODULE.bazel'
      - 'BUILD.bazel'
      - '.bazelrc'
      - '.github/workflows/eagle_build.yml'

concurrency:
  group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
  cancel-in-progress: true

permissions:
  contents: read

jobs:
  build:
    runs-on: [self-hosted, bazel]

    steps:
      - name: Checkout repository
        uses: actions/checkout@v6
        with:
          lfs: false
      - name: Build Eagle server
        run: bazel build //src/main/scala/net/eagle0/eagle:eagle_server
