name: build-bazel

on: [push, pull_request]

jobs:
  bazel:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [macos-latest]

    steps:
      - uses: actions/checkout@v4

      - uses: bazelbuild/setup-bazelisk@v2

      - name: Mount bazel cache # Optional
        uses: actions/cache@v3
        with:
          path: "~/.cache/bazel"
          key: bazel

      - name: bazel clean
        run: bazel clean
      
      - name: build bazel
        run: |
          bazel build //...
      
      - name: test
        run: ./bazel-bin/call-highs-example