Skip to content

Commit ceedf1d

Browse files
committed
ci: for WOA, split up git install from the rest so checks can run sooner.
1 parent 21c0afc commit ceedf1d

File tree

3 files changed

+46
-15
lines changed

3 files changed

+46
-15
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: 'Setup Git for Windows ARM64'
2+
description: 'Set up Git for Windows ARM64 environment with necessary tools'
3+
# maybe switch to winget someday?
4+
# Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe
5+
runs:
6+
using: "composite"
7+
steps:
8+
9+
- name: Check if Git is installed, returning step variable
10+
shell: powershell
11+
id: git-installed
12+
run: |
13+
if (Test-Path "C:\Program Files\Git\bin\git.exe") {
14+
Write-Host "Git is already installed"
15+
echo "::set-output name=git-installed::true"
16+
} else {
17+
Write-Host "Git is not installed"
18+
echo "::set-output name=git-installed::false"
19+
}
20+
21+
22+
- name: Install Git
23+
shell: powershell
24+
run: |
25+
$url = "https://github.com/git-for-windows/git/releases/download/v2.47.1.windows.2/Git-2.47.1.2-arm64.exe"
26+
Invoke-WebRequest -Uri $url -OutFile git-installer.exe
27+
Start-Process -FilePath .\git-installer.exe -ArgumentList "/VERYSILENT", "/NORESTART" -Wait
28+
if: steps.git-installed.outputs.git-installed == 'false'
29+
30+
31+
- name: Add Git and GNU tools (required for actions/cache to work (tar is needed)) to PATH
32+
shell: powershell
33+
run: |
34+
echo "C:\Program Files\Git\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
35+
echo "C:\Program Files\Git\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
36+

.github/actions/setup-win-arm64/action.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,6 @@ description: 'Set up Windows ARM64 environment with necessary tools'
55
runs:
66
using: "composite"
77
steps:
8-
9-
- name: Install Git (required for actions/cache to work (tar is needed))
10-
shell: powershell
11-
run: |
12-
$url = "https://github.com/git-for-windows/git/releases/download/v2.47.1.windows.2/Git-2.47.1.2-arm64.exe"
13-
Invoke-WebRequest -Uri $url -OutFile git-installer.exe
14-
Start-Process -FilePath .\git-installer.exe -ArgumentList "/VERYSILENT", "/NORESTART" -Wait
15-
16-
- name: Use GNU tar from Git
17-
shell: powershell
18-
run: echo "C:\Program Files\Git\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
19-
208
# - name: Cache tools
219
# uses: actions/cache@v4
2210
# id: cache-tools
@@ -26,6 +14,9 @@ runs:
2614
# C:\Users\runneradmin\.cargo
2715
# key: ${{ runner.os }}-arm64-tools-v3
2816

17+
- name: Setup Git
18+
uses: ./.github/actions/setup-git-win-arm64
19+
2920
- name: Install Visual Studio Build Tools (Preview)
3021
shell: powershell
3122
run: |
@@ -67,7 +58,6 @@ runs:
6758
run: |
6859
echo "Adding tools to PATH"
6960
echo "C:\BuildTools\Common7\Tools" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
70-
echo "C:\Program Files\Git\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
7161
echo "C:\BuildTools\VC\Tools\MSVC\$msvc_ver\bin\Hostx64\arm64" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
7262
echo "C:\BuildTools\VC\Tools\MSVC\$msvc_ver\bin\Hostx64\x64" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
7363
echo "$env:USERPROFILE\.cargo\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

.github/workflows/ci.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,10 @@ jobs:
141141
- name: Checkout code
142142
uses: actions/checkout@v4
143143

144-
- name: "WOA: Setup Windows ARM64"
145-
uses: ./.github/actions/setup-win-arm64
144+
- name: "WOA: Setup Git and GNU tools for Windows ARM64"
145+
uses: ./.github/actions/setup-git-win-arm64
146146
if: matrix.woa == 'true'
147+
147148
- name: "WOA: Checkout code again with git, so git commands work."
148149
uses: actions/checkout@v4
149150
if: matrix.woa == 'true'
@@ -157,6 +158,10 @@ jobs:
157158
key: ${{ matrix.name }}
158159
if: matrix.cross != 'true'
159160

161+
- name: "WOA: Install MSBUILD + Rust + Nasm + Git for Windows ARM64"
162+
uses: ./.github/actions/setup-win-arm64
163+
if: matrix.woa == 'true'
164+
160165
- uses: dtolnay/rust-toolchain@stable
161166
if: matrix.cross != 'true' && matrix.woa != 'true'
162167

0 commit comments

Comments
 (0)