# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

on: [push, pull_request]

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}

name: Test
jobs:
  test:
    strategy:
      fail-fast: false
      matrix:
        go-version: [1.24.x, 1.25.x]
        venv: [windows-2022, windows-2025, windows-11-arm, ubuntu-latest, macos-latest]
    runs-on: ${{ matrix.venv }}
    steps:
    - name: Install Go
      uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
      with:
        go-version: ${{ matrix.go-version }}

    - name: Checkout code
      uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

    - name: Run Tests
      run: go test -v ${{ matrix.venv != 'windows-11-arm' && '-race' || '' }} ./... # race not supported on windows/arm64

  conclusion:
    name: conclusion
    needs: test
    runs-on: ubuntu-latest
    if: always()
    steps:
      - name: Result
        run: ${{ needs.test.result == 'success' }}
