Repository navigation
sparse-index: do not expand the index during the working-tree walk under a virtual filesystem #367
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: VFS for Git Functional Tests | |
| on: | |
| push: | |
| branches: [ vfs-*, tentative/vfs-* ] | |
| pull_request: | |
| branches: [ vfs-*, features/* ] | |
| permissions: | |
| actions: read | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.architecture == 'aarch64' && 'windows-11-arm' || 'windows-2022' }} | |
| name: Build Git (${{ matrix.architecture }}) | |
| strategy: | |
| matrix: | |
| architecture: [ x86_64, aarch64 ] | |
| fail-fast: false | |
| steps: | |
| - name: Check out Git's source code | |
| uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 | |
| - name: Setup build tools | |
| uses: git-for-windows/setup-git-for-windows-sdk@aed153d1258c311b680b81584a72a1a4807401f0 # v2 | |
| with: | |
| architecture: ${{ matrix.architecture }} | |
| - name: Provide a minimal `install` | |
| shell: bash | |
| run: | | |
| test -x /usr/bin/install || | |
| tr % '\t' >/usr/bin/install <<-\EOF | |
| #!/bin/sh | |
| cmd=cp | |
| while test $# != 0 | |
| do | |
| %case "$1" in | |
| %-d) cmd="mkdir -p";; | |
| %-m) shift;; # ignore mode | |
| %*) break;; | |
| %esac | |
| %shift | |
| done | |
| exec $cmd "$@" | |
| EOF | |
| - name: Install GCC-compatible Rust target | |
| shell: bash | |
| run: | | |
| # The hosted Windows runners ship a rustup-managed Rust whose | |
| # default toolchain targets the MSVC ABI. That produces a | |
| # `gitcore.lib` which the MinGW GCC used by the rest of the | |
| # build cannot link. Install the precompiled `std` for a | |
| # GCC-compatible target triple matching the MSYS2 subsystem; | |
| # the Makefile selects the same triple via $(MSYSTEM) and | |
| # passes it to `cargo build --target`. | |
| case "$MSYSTEM" in | |
| CLANGARM64) target=aarch64-pc-windows-gnullvm ;; | |
| CLANG64) target=x86_64-pc-windows-gnullvm ;; | |
| CLANG32) target=i686-pc-windows-gnullvm ;; | |
| UCRT64) target=x86_64-pc-windows-gnullvm ;; | |
| MINGW64) target=x86_64-pc-windows-gnu ;; | |
| MINGW32) target=i686-pc-windows-gnu ;; | |
| *) echo "::error::Unsupported MSYSTEM: $MSYSTEM"; exit 1 ;; | |
| esac | |
| rustup target add "$target" | |
| - name: Build and install Git | |
| shell: bash | |
| env: | |
| NO_TCLTK: Yup | |
| run: | | |
| # We do require a VFS version | |
| def_ver="$(sed -n '/^DEF_VER=/{ | |
| s/^DEF_VER=\(.*vfs.*\)/\1/p | |
| tq # already found a *.vfs.* one, skip next line | |
| s/^DEF_VER=\(.*\)/\1.vfs.0.0/p | |
| :q | |
| q | |
| }' GIT-VERSION-GEN)" | |
| test -n "$def_ver" | |
| # VFSforGit cannot handle -rc versions; strip the `-rc` part, if any | |
| case "$def_ver" in | |
| *-rc*) def_ver=${def_ver%%-rc*}.vfs.${def_ver#*.vfs.};; | |
| esac | |
| # Ensure that `git version` reflects DEF_VER | |
| case "$(git describe --match "v[0-9]*vfs*" HEAD)" in | |
| ${def_ver%%.vfs.*}.vfs.*) ;; # okay, we can use this | |
| *) echo ${def_ver}.NNN.g$(git rev-parse --short HEAD) >version;; | |
| esac | |
| make -j5 DESTDIR="$GITHUB_WORKSPACE/MicrosoftGit/payload/${{ matrix.architecture }}" install | |
| # The test runners still ship the MINGW64 runtime. | |
| if test "$MSYSTEM" = UCRT64 | |
| then | |
| cp /ucrt64/bin/*.dll \ | |
| "$GITHUB_WORKSPACE/MicrosoftGit/payload/x86_64/ucrt64/bin/" | |
| fi | |
| - name: Upload Git artifact | |
| uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7 | |
| with: | |
| name: MicrosoftGit-${{ matrix.architecture }} | |
| path: MicrosoftGit | |
| package: | |
| runs-on: windows-2022 | |
| name: Package Git | |
| needs: build | |
| outputs: | |
| vfs_run_id: ${{ steps.find_run.outputs.run_id }} | |
| steps: | |
| - name: Download x86_64 build | |
| uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8 | |
| with: | |
| name: MicrosoftGit-x86_64 | |
| path: MicrosoftGit | |
| - name: Download aarch64 build | |
| uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8 | |
| with: | |
| name: MicrosoftGit-aarch64 | |
| path: MicrosoftGit | |
| - name: Create install script | |
| shell: bash | |
| run: | | |
| cat >"$GITHUB_WORKSPACE/MicrosoftGit/install.bat" <<'BATCH' | |
| @echo off | |
| if "%PROCESSOR_ARCHITECTURE%"=="ARM64" ( | |
| set GIT_PAYLOAD=%~dp0payload\aarch64 | |
| ) else ( | |
| set GIT_PAYLOAD=%~dp0payload\x86_64 | |
| ) | |
| rem Only needed for the MINGW64 to UCRT64 transition, until | |
| rem Actions runners ship Git for Windows v2.56.0 final. | |
| if not exist "%GIT_PAYLOAD%\ucrt64\bin\git.exe" goto install_git | |
| if exist "C:\Program Files\Git\ucrt64" goto install_git | |
| set "MINGIT_URL=https://github.com/git-for-windows/git/releases" | |
| set "MINGIT_URL=%MINGIT_URL%/download/v2.56.0-rc0.windows.1" | |
| "%SYSTEMROOT%\System32\curl.exe" -fL ^ | |
| "%MINGIT_URL%/MinGit-2.56.0-rc0-64-bit.zip" ^ | |
| -o "%RUNNER_TEMP%\MinGit.zip" || exit /b 1 | |
| "%SYSTEMROOT%\System32\tar.exe" -xf "%RUNNER_TEMP%\MinGit.zip" ^ | |
| -C "C:\Program Files\Git" cmd/git.exe || exit /b 1 | |
| :install_git | |
| echo Installing Git from %GIT_PAYLOAD% to "C:\Program Files\Git"... | |
| robocopy "%GIT_PAYLOAD%" "C:\Program Files\Git" /E /NFL /NDL /NJH /NJS /NS /NC | |
| if %ERRORLEVEL% GEQ 8 exit /b %ERRORLEVEL% | |
| echo C:\Program Files\Git\cmd>>"%GITHUB_PATH%" | |
| exit /b 0 | |
| BATCH | |
| - name: Upload Git artifact | |
| uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7 | |
| with: | |
| name: MicrosoftGit | |
| path: MicrosoftGit | |
| - name: Find latest VFSForGit build | |
| id: find_run | |
| shell: bash | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| run_id=$(gh run list \ | |
| --repo microsoft/VFSForGit \ | |
| --workflow build.yaml \ | |
| --branch master \ | |
| --status success \ | |
| --limit 1 \ | |
| --json databaseId \ | |
| -q '.[0].databaseId') | |
| test -n "$run_id" || { echo "::error::No successful VFSForGit build found"; exit 1; } | |
| # If the run was skipped, follow the annotation to the real run. | |
| # The skip notice may only appear on a re-attempt, so check | |
| # attempts from latest to first. | |
| attempts=$(gh api "repos/microsoft/VFSForGit/actions/runs/$run_id" \ | |
| --jq '.run_attempt') | |
| for attempt in $(seq "$attempts" -1 1); do | |
| job_id=$(gh api "repos/microsoft/VFSForGit/actions/runs/$run_id/attempts/$attempt/jobs" \ | |
| --jq '.jobs[] | select(.name == "Validation") | .id') | |
| test -n "$job_id" || continue | |
| skip_msg=$(gh api "repos/microsoft/VFSForGit/check-runs/$job_id/annotations" \ | |
| --jq '[.[] | select(.message | startswith("Skipping:"))][0].message // empty') | |
| test -n "$skip_msg" || continue | |
| real_id=$(echo "$skip_msg" | sed -n 's|.*/runs/\([0-9]*\).*|\1|p') | |
| if [ -n "$real_id" ] && [ "$real_id" != "$run_id" ]; then | |
| echo "::notice::Skipped run $run_id (attempt $attempt), following to real run $real_id" | |
| run_id=$real_id | |
| fi | |
| break | |
| done | |
| echo "run_id=$run_id" >> "$GITHUB_OUTPUT" | |
| echo ::notice::Using VFSForGit build with run_id=$run_id | |
| functional_tests: | |
| name: Functional Tests | |
| needs: package | |
| uses: microsoft/VFSForGit/.github/workflows/functional-tests.yaml@c5ea3d5dc5e44f51ffa7876f46409dfe650de851 # master | |
| with: | |
| vfs_repository: microsoft/VFSForGit | |
| vfs_run_id: ${{ needs.package.outputs.vfs_run_id }} |