name: "Nix Build"
on:
  pull_request:
  push:
    branches:
      - main

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

jobs:
  tests:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        ocamlVersion: [5_2]
    steps:
    - uses: actions/checkout@v2
    - uses: cachix/install-nix-action@v21
      with:
        extra_nix_config: |
          extra-substituters = https://anmonteiro.nix-cache.workers.dev
          extra-trusted-public-keys = ocaml.nix-cache.com-1:/xI2h2+56rwFfKyyFVbkJSeGqSIYMC/Je+7XXqGKDIY=
    - name: "Run Nix tests"
      run: nix build .#

