Skip to content
Merged
10 changes: 5 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,146 +17,146 @@

jobs:
validate:
runs-on: windows-2025
name: Validation
steps:
- name: Checkout source
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Validate Microsoft Git version
shell: pwsh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
& "$env:GITHUB_WORKSPACE\.github\workflows\scripts\validate_release.ps1" `
-Repository microsoft/git `
-Tag $env:GIT_VERSION && `
Write-Host ::notice title=Validation::Using microsoft/git version $env:GIT_VERSION

build:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {{contents: read}}
runs-on: windows-2025
name: Build and Unit Test
needs: validate

strategy:
matrix:
configuration: [ Debug, Release ]

steps:
- name: Checkout source
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
path: src

- name: Install .NET SDK
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.0.413

- name: Add MSBuild to PATH
uses: microsoft/[email protected]

- name: Build VFS for Git
shell: cmd
run: src\scripts\Build.bat ${{ matrix.configuration }}

- name: Run unit tests
shell: cmd
run: src\scripts\RunUnitTests.bat ${{ matrix.configuration }}

- name: Create build artifacts
shell: cmd
run: src\scripts\CreateBuildArtifacts.bat ${{ matrix.configuration }} artifacts

- name: Download microsoft/git installers
shell: cmd
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release download %GIT_VERSION% --repo microsoft/git --pattern "Git*.exe" --dir artifacts\GVFS.Installers

- name: Upload functional tests drop
uses: actions/upload-artifact@v4
with:
name: FunctionalTests_${{ matrix.configuration }}
path: artifacts\GVFS.FunctionalTests

- name: Upload FastFetch drop
uses: actions/upload-artifact@v4
with:
name: FastFetch_${{ matrix.configuration }}
path: artifacts\FastFetch

- name: Upload installers
uses: actions/upload-artifact@v4
with:
name: Installers_${{ matrix.configuration }}
path: artifacts\GVFS.Installers

functional_test:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {{contents: read}}
runs-on: ${{ matrix.architecture == 'arm64' && 'windows-11-arm' || 'windows-2025' }}
name: Functional Tests
needs: build

strategy:
matrix:
configuration: [ Debug, Release ]
architecture: [ x86_64, arm64 ]

steps:
- name: Download installers
uses: actions/download-artifact@v4
uses: actions/download-artifact@v5
with:
name: Installers_${{ matrix.configuration }}
path: install

- name: Download functional tests drop
uses: actions/download-artifact@v4
uses: actions/download-artifact@v5
with:
name: FunctionalTests_${{ matrix.configuration }}
path: ft

- name: ProjFS details (pre-install)
shell: cmd
run: install\info.bat

- name: Install product
shell: cmd
run: install\install.bat

- name: ProjFS details (post-install)
shell: cmd
run: install\info.bat

- name: Upload installation logs
if: always()
uses: actions/upload-artifact@v4
with:
name: InstallationLogs_${{ matrix.configuration }}_${{ matrix.architecture }}
path: install\logs

- name: Run functional tests
shell: cmd
run: |
SET PATH=C:\Program Files\VFS for Git;%PATH%
SET GIT_TRACE2_PERF=C:\temp\git-trace2.log
ft\GVFS.FunctionalTests.exe /result:TestResult.xml --ci

- name: Upload functional test results
if: always()
uses: actions/upload-artifact@v4
with:
name: FunctionalTests_Results_${{ matrix.configuration }}_${{ matrix.architecture }}
path: TestResult.xml

- name: Upload Git trace2 output
if: always()
uses: actions/upload-artifact@v4
with:
name: GitTrace2_${{ matrix.configuration }}_${{ matrix.architecture }}
path: C:\temp\git-trace2.log

- name: ProjFS details (post-test)
if: always()
shell: cmd
run: install\info.bat

Check warning

Code scanning / CodeQL

Workflow does not contain permissions

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {{}}
9 changes: 9 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@
<OutDir>$(ProjectOutPath)bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(ProjectOutPath)intermediate\$(Platform)\$(Configuration)\</IntDir>
<GeneratedIncludePath>$(IntDir)include\</GeneratedIncludePath>
<!--
Make sure that we don't accidentally use Windows APIs only available after
Windows 10 build 16299 (aka '1709', 'RS3', and 'Fall Creators Update').
The minimum Windows version that includes the final design of the
Projected File System (ProjFS) APIs was actually Windows 10 version 1809
(build 17763), but VFS for Git also supports using the older design of the
ProjFS APIs from that version.
-->
<TargetPlatformMinVersion>10.0.16299.0</TargetPlatformMinVersion>
</PropertyGroup>

</Project>
6 changes: 0 additions & 6 deletions scripts/Build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@ SET VSWHERE_VER=2.6.7
"%NUGET_EXEC%" install vswhere -Version %VSWHERE_VER% -OutputDirectory %VFS_PACKAGESDIR% || exit /b 1
SET VSWHERE_EXEC="%VFS_PACKAGESDIR%\vswhere.%VSWHERE_VER%\tools\vswhere.exe"

REM Assumes default installation location for Windows 10 SDKs
IF NOT EXIST "C:\Program Files (x86)\Windows Kits\10\Include\10.0.16299.0" (
ECHO ERROR: Could not find Windows 10 SDK Version 16299
EXIT /B 1
)

REM Use vswhere to find the latest VS installation with the MSBuild component
REM See https://github.com/Microsoft/vswhere/wiki/Find-MSBuild
FOR /F "tokens=* USEBACKQ" %%F IN (`%VSWHERE_EXEC% -all -prerelease -latest -products * -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\amd64\MSBuild.exe`) DO (
Expand Down
Loading