name: Volume Shadow Copy Test
on:
  push:
    branches: [ master ]
    tags:
      - v*
  pull_request:
    branches: [ master ]
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
jobs:
  vss-test:
    name: Volume Shadow Copy Test
    runs-on: windows-latest
    steps:
    - name: Check out repository
      uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
      with:
        fetch-depth: 0
    - name: Set up Go
      uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
      with:
        go-version-file: 'go.mod'
    - name: Install gsudo
      shell: bash
      run: |
        choco install -y --no-progress gsudo
        echo "C:\tools\gsudo\Current" >> $GITHUB_PATH
    - name: Admin Test
      run: gsudo make os-snapshot-tests
    - name: Non-Admin Test
      run: gsudo -i Medium make os-snapshot-tests
    - name: Upload Logs
      uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
      with:
        name: logs
        path: .logs/**/*.log
        if-no-files-found: ignore
      if: ${{ always() }}
