Skip to content

Commit f8e9116

Browse files
authored
Merge pull request #30 from ni/users/ssantolu/dev
fix long path issue
2 parents 1f7d49b + 2c1c10e commit f8e9116

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/target-smoke-tests.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,19 @@ jobs:
3232
- name: Checkout
3333
uses: actions/checkout@v4
3434

35+
- name: Configure Git long paths and short workspace path
36+
shell: pwsh
37+
run: |
38+
git config --global core.longpaths true
39+
40+
if (Test-Path "X:\") {
41+
subst X: /d
42+
}
43+
44+
subst X: $env:GITHUB_WORKSPACE
45+
"SHORT_WORKSPACE=X:\" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
46+
Write-Host "Mapped $env:GITHUB_WORKSPACE to X:\\"
47+
3548
- name: Setup Python
3649
uses: actions/setup-python@v5
3750
with:
@@ -41,13 +54,15 @@ jobs:
4154
- name: Install Python dependencies
4255
shell: pwsh
4356
run: |
57+
Set-Location $env:SHORT_WORKSPACE
4458
python -m pip install --upgrade pip
4559
python -m pip install -r requirements.txt
4660
4761
- name: Discover target folders
4862
id: discover
4963
shell: pwsh
5064
run: |
65+
Set-Location $env:SHORT_WORKSPACE
5166
$targets = Get-ChildItem targets -Directory |
5267
Where-Object { Test-Path (Join-Path $_.FullName "projectsettings.ini") } |
5368
Sort-Object Name |
@@ -63,6 +78,7 @@ jobs:
6378
- name: Run install-deps once
6479
shell: pwsh
6580
run: |
81+
Set-Location $env:SHORT_WORKSPACE
6682
$targets = "${{ steps.discover.outputs.targets }}".Split(',', [System.StringSplitOptions]::RemoveEmptyEntries)
6783
$firstTarget = $targets[0]
6884
$inputArgs = ""
@@ -89,6 +105,7 @@ jobs:
89105
- name: Run per-target gen-target and create-project
90106
shell: pwsh
91107
run: |
108+
Set-Location $env:SHORT_WORKSPACE
92109
$targets = "${{ steps.discover.outputs.targets }}".Split(',', [System.StringSplitOptions]::RemoveEmptyEntries)
93110
94111
foreach ($target in $targets) {
@@ -103,3 +120,11 @@ jobs:
103120
Write-Host "::endgroup::"
104121
}
105122
}
123+
124+
- name: Cleanup mapped drive
125+
if: always()
126+
shell: pwsh
127+
run: |
128+
if (Test-Path "X:\") {
129+
subst X: /d
130+
}

0 commit comments

Comments
 (0)