name: build-and-test-windows
on:
  push:
    branches: [ main ]
    tags:
      - 'v[0-9]+.[0-9]+.[0-9]+*'
  pull_request:

jobs:
  windows-unittest:
    runs-on: windows-latest
    steps:
      - name: Checkout Repo
        uses: actions/checkout@v3
      - name: Setup Go
        uses: actions/setup-go@v3
        with:
          go-version: 1.17
      - name: Cache Go
        uses: actions/cache@v3
        env:
          cache-name: cache-go-modules
        with:
          path: |
            ~\go\pkg\mod
            ~\AppData\Local\go-build
          key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
      - name: Run Unit tests
        run: go test ./...
