name: Windows

on:
  push:
    branches:
      - master
  pull_request:

env:
  CARGO_INCREMENTAL: 0
  RUST_BACKTRACE: short

jobs:
  run-tests:
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v3

      - name: Set up Rust
        uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: 1.56.0

      - name: Cache dependencies
        uses: Swatinem/rust-cache@842ef286fff290e445b90b4002cc9807c3669641

      - name: Compile
        run: cargo build --benches --tests

      - name: Run tests
        timeout-minutes: 10
        run: |
          $env:TEST_GIT='C:\Program Files\Git\cmd\git.exe'
          $env:TEST_GIT_EXEC_PATH='C:\Program Files\Git\cmd'
          cargo test
